|
@@ -18,31 +18,35 @@ import inspect
|
18
|
18
|
|
19
|
19
|
class all_functions(object):
|
20
|
20
|
def __init__(self, mqtt_client):
|
21
|
|
- self.rooms = {}
|
22
|
|
- self.__devices__ = None
|
|
21
|
+ self.mqtt_client = mqtt_client
|
23
|
22
|
#
|
24
|
|
- # ground floor west
|
|
23
|
+ self.__devices__ = None
|
25
|
24
|
#
|
26
|
|
- self.gfw_floor = ground_floor_west_floor(mqtt_client)
|
27
|
|
- self.gfw_marion = ground_floor_west_marion(mqtt_client)
|
28
|
|
- self.gfw_dirk = ground_floor_west_dirk(mqtt_client)
|
|
25
|
+ # add rooms
|
29
|
26
|
#
|
|
27
|
+ # # ground floor west
|
|
28
|
+ self.gfw_floor = ground_floor_west_floor(self.mqtt_client)
|
|
29
|
+ self.gfw_marion = ground_floor_west_marion(self.mqtt_client)
|
|
30
|
+ self.gfw_dirk = ground_floor_west_dirk(self.mqtt_client)
|
30
|
31
|
# first floor west
|
31
|
|
- #
|
32
|
|
- self.ffw_julian = first_floor_west_julian(mqtt_client)
|
33
|
|
- self.ffw_living = first_floor_west_living(mqtt_client)
|
34
|
|
- #
|
|
32
|
+ self.ffw_julian = first_floor_west_julian(self.mqtt_client)
|
|
33
|
+ self.ffw_living = first_floor_west_living(self.mqtt_client)
|
35
|
34
|
# first floor east
|
|
35
|
+ self.ffe_floor = first_floor_east_floor(self.mqtt_client)
|
|
36
|
+ self.ffe_kitchen = first_floor_east_kitchen(self.mqtt_client)
|
|
37
|
+ self.ffe_dining = first_floor_east_dining(self.mqtt_client)
|
|
38
|
+ self.ffe_sleep_madi = first_floor_east_sleep_madi(self.mqtt_client)
|
|
39
|
+ self.ffe_living = first_floor_east_living(self.mqtt_client)
|
|
40
|
+ #
|
|
41
|
+ # additional functionality
|
36
|
42
|
#
|
37
|
|
- self.ffe_floor = first_floor_east_floor(mqtt_client)
|
38
|
|
- self.ffe_kitchen = first_floor_east_kitchen(mqtt_client)
|
39
|
|
- self.ffe_dining = first_floor_east_dining(mqtt_client)
|
40
|
|
- self.ffe_sleep_madi = first_floor_east_sleep_madi(mqtt_client)
|
41
|
|
- self.ffe_living = first_floor_east_living(mqtt_client)
|
|
43
|
+ self.init_input_device_sleep_madi_functionality()
|
|
44
|
+
|
|
45
|
+ def init_input_device_sleep_madi_functionality(self):
|
42
|
46
|
#
|
43
|
|
- # Input devices sleep_madi
|
|
47
|
+ self.ffe_button_tradfri_sleep = devices.tradfri_button(
|
|
48
|
+ self.mqtt_client, topic="zigbee_og_e/input_device/og_east")
|
44
|
49
|
#
|
45
|
|
- self.ffe_button_tradfri_sleep = devices.tradfri_button(mqtt_client, topic="zigbee_og_e/input_device/og_east")
|
46
|
50
|
self.ffe_button_tradfri_sleep.add_callback(devices.tradfri_button.KEY_ACTION, "toggle",
|
47
|
51
|
self.ffe_sleep_madi.toggle_main_light)
|
48
|
52
|
self.ffe_button_tradfri_sleep.add_callback(devices.tradfri_button.KEY_ACTION, "brightness_up_click",
|
|
@@ -51,6 +55,8 @@ class all_functions(object):
|
51
|
55
|
self.ffe_sleep_madi.toggle_bed_light_di)
|
52
|
56
|
self.ffe_button_tradfri_sleep.add_callback(devices.tradfri_button.KEY_ACTION, "arrow_right_click",
|
53
|
57
|
self.ffe_floor.toggle_main_light)
|
|
58
|
+ self.ffe_button_tradfri_sleep.add_callback(devices.tradfri_button.KEY_ACTION, None,
|
|
59
|
+ self.ffe_sleep_madi.fade_bed_light)
|
54
|
60
|
|
55
|
61
|
def devicelist(self):
|
56
|
62
|
if self.__devices__ is None:
|