blob: 8ca12d89915dbf055e914413bf70edd89b9b9bf2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# provides:
# switch
# automation
# binary_sensor
# sensor
# input_select
# timer
let
inherit (import ../lib) esphome;
sonoff_s20 = host: {
sensor = [
(esphome.ip { inherit host;})
(esphome.wifi { inherit host;})
(esphome.temp { inherit host;})
(esphome.hum { inherit host;})
];
binary_sensor = [
(esphome.btn { inherit host;})
];
light = [
(esphome.monoled { inherit host;})
];
switch = [
(esphome.relay { inherit host;})
(esphome.restart { inherit host;})
];
};
dusche = sonoff_s20 "dusche_plug";
schlafzimmer = sonoff_s20 "schlafzimmer_plug";
in {
sensor = [
(esphome.pressure {host = "dusche_plug";})
]
++ dusche.sensor
++ schlafzimmer.sensor;
binary_sensor =
dusche.binary_sensor
++ schlafzimmer.binary_sensor;
light =
dusche.light
++ schlafzimmer.light;
switch =
dusche.switch
++ schlafzimmer.switch;
}
|