|
@@ -40,7 +40,7 @@ class base(object):
|
40
|
40
|
|
41
|
41
|
class gfw_floor(base):
|
42
|
42
|
def __init__(self, mqtt_client):
|
43
|
|
- self.gui_switch_main_light = gui_light(mqtt_client, config.TOPIC_GFW_FLOOR_MAIN_LIGHT_GUI_SWITCH, True, False, False)
|
|
43
|
+ self.gui_main_light = gui_light(mqtt_client, config.TOPIC_GFW_FLOOR_MAIN_LIGHT_GUI, True, True, True)
|
44
|
44
|
self.main_light = shelly(mqtt_client, config.TOPIC_GFW_FLOOR_MAIN_LIGHT_SHELLY, input_0_func=shelly.INPUT_FUNC_OUT1_TRIGGER)
|
45
|
45
|
self.main_light.add_channel_name(shelly.KEY_OUTPUT_0, "Main Light")
|
46
|
46
|
self.main_light_zigbee_1 = tradfri_light(mqtt_client, config.TOPIC_GFW_FLOOR_MAIN_LIGHT_1_ZIGBEE, True, True, True, False)
|
|
@@ -49,36 +49,36 @@ class gfw_floor(base):
|
49
|
49
|
self.main_light_zigbee_2 = tradfri_light(mqtt_client, config.TOPIC_GFW_FLOOR_MAIN_LIGHT_2_ZIGBEE, True, True, True, False)
|
50
|
50
|
self.main_light.add_callback(shelly.KEY_OUTPUT_0, self.main_light_zigbee_2.power_on, "on")
|
51
|
51
|
self.main_light.add_callback(shelly.KEY_OUTPUT_0, self.main_light_zigbee_1.power_off, "off")
|
52
|
|
- self.gui_br_ct_main_light = gui_light(mqtt_client, config.TOPIC_GFW_FLOOR_MAIN_LIGHT_GUI_BR_CT, False, True, True)
|
53
|
52
|
|
54
|
53
|
|
55
|
54
|
class gfw_marion(base):
|
56
|
55
|
def __init__(self, mqtt_client):
|
57
|
|
- self.gui_switch_main_light = gui_light(mqtt_client, config.TOPIC_GFW_MARION_MAIN_LIGHT_GUI_SWITCH, True, False, False)
|
|
56
|
+ self.gui_main_light = gui_light(mqtt_client, config.TOPIC_GFW_MARION_MAIN_LIGHT_GUI, True, False, False)
|
58
|
57
|
self.main_light = shelly(mqtt_client, config.TOPIC_GFW_MARION_MAIN_LIGHT_SHELLY, input_0_func=shelly.INPUT_FUNC_OUT1_TRIGGER)
|
59
|
58
|
self.main_light.add_channel_name(shelly.KEY_OUTPUT_0, "Main Light")
|
60
|
59
|
|
61
|
60
|
|
62
|
61
|
class gfw_dirk(base):
|
63
|
62
|
def __init__(self, mqtt_client):
|
64
|
|
- self.gui_switch_main_light = gui_light(mqtt_client, config.TOPIC_GFW_DIRK_MAIN_LIGHT_GUI_SWITCH, True, False, False)
|
|
63
|
+ self.gui_main_light = gui_light(mqtt_client, config.TOPIC_GFW_DIRK_MAIN_LIGHT_GUI, True, True, True)
|
65
|
64
|
self.main_light = shelly(mqtt_client, config.TOPIC_GFW_DIRK_MAIN_LIGHT_SHELLY, input_0_func=shelly.INPUT_FUNC_OUT1_TRIGGER)
|
66
|
65
|
self.main_light.add_channel_name(shelly.KEY_OUTPUT_0, "Main Light")
|
67
|
66
|
self.main_light_zigbee = tradfri_light(mqtt_client, config.TOPIC_GFW_DIRK_MAIN_LIGHT_ZIGBEE, True, True, True)
|
68
|
67
|
self.main_light.add_callback(shelly.KEY_OUTPUT_0, self.main_light_zigbee.power_on, "on")
|
69
|
68
|
self.main_light.add_callback(shelly.KEY_OUTPUT_0, self.main_light_zigbee.power_off, "off")
|
70
|
|
- self.gui_br_ct_main_light = gui_light(mqtt_client, config.TOPIC_GFW_DIRK_MAIN_LIGHT_GUI_BR_CT, False, True, True)
|
71
|
69
|
#
|
72
|
70
|
self.powerplug = my_powerplug(mqtt_client, config.TOPIC_GFW_DIRK_POWERPLUG)
|
73
|
71
|
self.powerplug.add_channel_name(my_powerplug.KEY_OUTPUT_0, "Amplifier")
|
74
|
|
- self.powerplug.add_channel_name(my_powerplug.KEY_OUTPUT_1, "Desk Light")
|
75
|
|
- self.powerplug.add_channel_name(my_powerplug.KEY_OUTPUT_2, "CD-Player")
|
76
|
|
- self.powerplug.add_channel_name(my_powerplug.KEY_OUTPUT_3, "PC-Dock")
|
77
|
|
- self.gui_switch_amplifier = gui_light(mqtt_client, config.TOPIC_GFW_DIRK_AMPLIFIER_GUI_SWITCH, True, False, False)
|
78
|
|
- self.gui_switch_desk_light = gui_light(mqtt_client, config.TOPIC_GFW_DIRK_DESK_LIGHT_GUI_SWITCH, True, False, False)
|
79
|
|
- self.gui_br_ct_desk_light = gui_light(mqtt_client, config.TOPIC_GFW_DIRK_DESK_LIGHT_GUI_BR_CT, False, True, True)
|
80
|
|
- self.gui_switch_cd_player = gui_light(mqtt_client, config.TOPIC_GFW_DIRK_CD_PLAYER_GUI_SWITCH, True, False, False)
|
81
|
|
- self.gui_switch_pc_dock = gui_light(mqtt_client, config.TOPIC_GFW_DIRK_PC_DOCK_GUI_SWITCH, True, False, False)
|
|
72
|
+ self.powerplug.add_channel_name(my_powerplug.KEY_OUTPUT_1, "Desk_Light")
|
|
73
|
+ self.powerplug.add_channel_name(my_powerplug.KEY_OUTPUT_2, "CD_Player")
|
|
74
|
+ self.powerplug.add_channel_name(my_powerplug.KEY_OUTPUT_3, "PC_Dock")
|
|
75
|
+ self.gui_amplifier = gui_light(mqtt_client, config.TOPIC_GFW_DIRK_AMPLIFIER_GUI, True, False, False)
|
|
76
|
+ self.gui_desk_light = gui_light(mqtt_client, config.TOPIC_GFW_DIRK_DESK_LIGHT_GUI, True, True, True)
|
|
77
|
+ self.desk_light_zigbee = tradfri_light(mqtt_client, config.TOPIC_GFW_DIRK_DESK_LIGHT_ZIGBEE, True, True, True)
|
|
78
|
+ self.powerplug.add_callback(my_powerplug.KEY_OUTPUT_1, self.desk_light_zigbee.power_on, True)
|
|
79
|
+ self.powerplug.add_callback(my_powerplug.KEY_OUTPUT_1, self.desk_light_zigbee.power_off, False)
|
|
80
|
+ self.gui_cd_player = gui_light(mqtt_client, config.TOPIC_GFW_DIRK_CD_PLAYER_GUI, True, False, False)
|
|
81
|
+ self.gui_pc_dock = gui_light(mqtt_client, config.TOPIC_GFW_DIRK_PC_DOCK_GUI, True, False, False)
|
82
|
82
|
#
|
83
|
83
|
self.remote = remote(mqtt_client, config.TOPIC_GFW_DIRK_AMPLIFIER_REMOTE)
|
84
|
84
|
#
|
|
@@ -98,18 +98,17 @@ class gfw(base):
|
98
|
98
|
|
99
|
99
|
class ffw_julian(base):
|
100
|
100
|
def __init__(self, mqtt_client):
|
101
|
|
- self.gui_switch_main_light = gui_light(mqtt_client, config.TOPIC_FFW_JULIAN_MAIN_LIGHT_GUI_SWITCH, True, False, False)
|
|
101
|
+ self.gui_main_light = gui_light(mqtt_client, config.TOPIC_FFW_JULIAN_MAIN_LIGHT_GUI, True, True, True)
|
102
|
102
|
self.main_light = shelly(mqtt_client, config.TOPIC_FFW_JULIAN_MAIN_LIGHT_SHELLY, input_0_func=shelly.INPUT_FUNC_OUT1_TRIGGER)
|
103
|
103
|
self.main_light.add_channel_name(shelly.KEY_OUTPUT_0, "Main Light")
|
104
|
104
|
self.main_light_zigbee = tradfri_light(mqtt_client, config.TOPIC_FFW_JULIAN_MAIN_LIGHT_ZIGBEE, True, True, True)
|
105
|
105
|
self.main_light.add_callback(shelly.KEY_OUTPUT_0, self.main_light_zigbee.power_on, "on")
|
106
|
106
|
self.main_light.add_callback(shelly.KEY_OUTPUT_0, self.main_light_zigbee.power_off, "off")
|
107
|
|
- self.gui_br_ct_main_light = gui_light(mqtt_client, config.TOPIC_FFW_JULIAN_MAIN_LIGHT_GUI_BR_CT, False, True, True)
|
108
|
107
|
|
109
|
108
|
|
110
|
109
|
class ffw_livingroom(base):
|
111
|
110
|
def __init__(self, mqtt_client):
|
112
|
|
- self.gui_switch_main_light = gui_light(mqtt_client, config.TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_GUI_SWITCH, True, False, False)
|
|
111
|
+ self.gui_main_light = gui_light(mqtt_client, config.TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_GUI, True, False, False)
|
113
|
112
|
self.main_light = shelly(mqtt_client, config.TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_SHELLY, input_0_func=shelly.INPUT_FUNC_OUT1_TRIGGER)
|
114
|
113
|
self.main_light.add_channel_name(shelly.KEY_OUTPUT_0, "Main Light")
|
115
|
114
|
|
|
@@ -122,18 +121,18 @@ class ffw(base):
|
122
|
121
|
|
123
|
122
|
class ffe_floor(base):
|
124
|
123
|
def __init__(self, mqtt_client):
|
125
|
|
- self.gui_switch_main_light = gui_light(mqtt_client, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_GUI_SWITCH, True, False, False)
|
|
124
|
+ self.gui_main_light = gui_light(mqtt_client, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_GUI, True, False, False)
|
126
|
125
|
self.main_light = shelly(mqtt_client, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_SHELLY, input_0_func=shelly.INPUT_FUNC_OUT1_TRIGGER)
|
127
|
126
|
self.main_light.add_channel_name(shelly.KEY_OUTPUT_0, "Main Light")
|
128
|
127
|
|
129
|
128
|
|
130
|
129
|
class ffe_kitchen(base):
|
131
|
130
|
def __init__(self, mqtt_client):
|
132
|
|
- self.gui_switch_main_light = gui_light(mqtt_client, config.TOPIC_FFE_KITCHEN_MAIN_LIGHT_GUI_SWITCH, True, False, False)
|
|
131
|
+ self.gui_main_light = gui_light(mqtt_client, config.TOPIC_FFE_KITCHEN_MAIN_LIGHT_GUI, True, False, False)
|
133
|
132
|
self.main_light = shelly(mqtt_client, config.TOPIC_FFE_KITCHEN_MAIN_LIGHT_SHELLY, input_0_func=shelly.INPUT_FUNC_OUT1_TRIGGER)
|
134
|
133
|
self.main_light.add_channel_name(shelly.KEY_OUTPUT_0, "Main Light")
|
135
|
134
|
#
|
136
|
|
- self.gui_switch_circulation_pump = gui_light(mqtt_client, config.TOPIC_FFE_KITCHEN_CIRCULATION_PUMP_GUI_SWITCH, True, False, False)
|
|
135
|
+ self.gui_circulation_pump = gui_light(mqtt_client, config.TOPIC_FFE_KITCHEN_CIRCULATION_PUMP_GUI, True, False, False)
|
137
|
136
|
self.circulation_pump = shelly(mqtt_client, config.TOPIC_FFE_KITCHEN_CIRCULATION_PUMP_SHELLY,
|
138
|
137
|
input_0_func=shelly.INPUT_FUNC_OUT1_TRIGGER, output_0_auto_off=10*60)
|
139
|
138
|
self.circulation_pump.add_channel_name(shelly.KEY_OUTPUT_0, "Circulation Pump")
|
|
@@ -142,29 +141,28 @@ class ffe_kitchen(base):
|
142
|
141
|
|
143
|
142
|
class ffe_diningroom(base):
|
144
|
143
|
def __init__(self, mqtt_client):
|
145
|
|
- self.gui_switch_main_light = gui_light(mqtt_client, config.TOPIC_FFE_DININGROOM_MAIN_LIGHT_GUI_SWITCH, True, False, False)
|
|
144
|
+ self.gui_main_light = gui_light(mqtt_client, config.TOPIC_FFE_DININGROOM_MAIN_LIGHT_GUI, True, False, False)
|
146
|
145
|
self.main_light = shelly(mqtt_client, config.TOPIC_FFE_DININGROOM_MAIN_LIGHT_SHELLY, input_0_func=shelly.INPUT_FUNC_OUT1_TRIGGER)
|
147
|
146
|
self.main_light.add_channel_name(shelly.KEY_OUTPUT_0, "Main Light")
|
148
|
|
- self.gui_switch_floor_lamp = gui_light(mqtt_client, config.TOPIC_FFE_DININGROOM_FLOOR_LAMP_GUI_SWITCH, True, False, False)
|
|
147
|
+ self.gui_floor_lamp = gui_light(mqtt_client, config.TOPIC_FFE_DININGROOM_FLOOR_LAMP_GUI, True, False, False)
|
149
|
148
|
self.floor_lamp = silvercrest_powerplug(mqtt_client, config.TOPIC_FFE_DININGROOM_FLOOR_LAMP_POWERPLUG)
|
150
|
149
|
self.floor_lamp.add_channel_name(silvercrest_powerplug.KEY_OUTPUT_0, "Floor Lamp")
|
151
|
|
- self.garland = silvercrest_powerplug(mqtt_client, config.TOPIC_FFE_DININGROOM_GARLAND_POWERPLUG)
|
152
|
|
- self.garland.add_channel_name(silvercrest_powerplug, "Garland")
|
|
150
|
+ if config.CHRISTMAS:
|
|
151
|
+ self.garland = silvercrest_powerplug(mqtt_client, config.TOPIC_FFE_DININGROOM_GARLAND_POWERPLUG)
|
|
152
|
+ self.garland.add_channel_name(silvercrest_powerplug, "Garland")
|
153
|
153
|
|
154
|
154
|
|
155
|
155
|
class ffe_sleep(base):
|
156
|
156
|
def __init__(self, mqtt_client):
|
157
|
|
- self.gui_switch_main_light = gui_light(mqtt_client, config.TOPIC_FFE_SLEEP_MAIN_LIGHT_GUI_SWITCH, True, False, False)
|
|
157
|
+ self.gui_main_light = gui_light(mqtt_client, config.TOPIC_FFE_SLEEP_MAIN_LIGHT_GUI, True, True, True)
|
158
|
158
|
self.main_light = shelly(mqtt_client, config.TOPIC_FFE_SLEEP_MAIN_LIGHT_SHELLY, input_0_func=shelly.INPUT_FUNC_OUT1_TRIGGER)
|
159
|
159
|
self.main_light.add_channel_name(shelly.KEY_OUTPUT_0, "Main Light")
|
160
|
160
|
self.main_light_zigbee = tradfri_light(mqtt_client, config.TOPIC_FFE_SLEEP_MAIN_LIGHT_ZIGBEE, True, True, True)
|
161
|
161
|
self.main_light.add_callback(shelly.KEY_OUTPUT_0, self.main_light_zigbee.power_on, "on")
|
162
|
162
|
self.main_light.add_callback(shelly.KEY_OUTPUT_0, self.main_light_zigbee.power_off, "off")
|
163
|
|
- self.gui_br_ct_main_light = gui_light(mqtt_client, config.TOPIC_FFE_SLEEP_MAIN_LIGHT_GUI_BR_CT, False, True, True)
|
164
|
163
|
#
|
165
|
|
- self.gui_switch_bed_light_di = gui_light(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_DI_GUI_SWITCH, True, False, False)
|
|
164
|
+ self.gui_bed_light_di = gui_light(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_DI_GUI, True, True, False)
|
166
|
165
|
self.bed_light_di_zigbee = tradfri_light(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_DI_ZIGBEE, True, True, False)
|
167
|
|
- self.gui_br_ct_bed_light_di = gui_light(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_DI_GUI_BR_CT, False, True, False)
|
168
|
166
|
#
|
169
|
167
|
self.input_device = tradfri_button(mqtt_client, config.TOPIC_FFE_SLEEP_INPUT_DEVICE)
|
170
|
168
|
self.led_array = gui_led_array(mqtt_client, config.TOPIC_FFE_SLEEP_DEVICE_CHOOSER_LED)
|
|
@@ -179,17 +177,21 @@ class ffe_sleep(base):
|
179
|
177
|
|
180
|
178
|
class ffe_livingroom(base):
|
181
|
179
|
def __init__(self, mqtt_client):
|
182
|
|
- self.gui_switch_main_light = gui_light(mqtt_client, config.TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_GUI_SWITCH, True, False, False)
|
|
180
|
+ self.gui_main_light = gui_light(mqtt_client, config.TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_GUI, True, True, True)
|
183
|
181
|
self.main_light = shelly(mqtt_client, config.TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_SHELLY, input_0_func=shelly.INPUT_FUNC_OUT1_TRIGGER)
|
184
|
182
|
self.main_light.add_channel_name(shelly.KEY_OUTPUT_0, "Main Light")
|
185
|
183
|
self.main_light_zigbee = tradfri_light(mqtt_client, config.TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_ZIGBEE, True, True, True)
|
186
|
184
|
self.main_light.add_callback(shelly.KEY_OUTPUT_0, self.main_light_zigbee.power_on, "on")
|
187
|
185
|
self.main_light.add_callback(shelly.KEY_OUTPUT_0, self.main_light_zigbee.power_off, "off")
|
188
|
|
- self.gui_br_ct_main_light = gui_light(mqtt_client, config.TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_GUI_BR_CT, False, True, True)
|
189
|
186
|
for i in range(1, 7):
|
190
|
|
- setattr(self, "floor_lamp_%d" % i, tradfri_light(mqtt_client, config.TOPIC_FFE_LIVINGROOM_FLOOR_LAMP_ZIGBEE % i, True, True, True))
|
191
|
|
- self.gui_switch_floor_lamp = gui_light(mqtt_client, config.TOPIC_FFE_LIVINGROOM_FLOOR_LAMP_GUI_SWITCH, True, False, False)
|
192
|
|
- self.gui_br_ct_floor_lamp = gui_light(mqtt_client, config.TOPIC_FFE_LIVINGROOM_FLOOR_LAMP_GUI_BR_CT, False, True, True)
|
|
187
|
+ setattr(self, "floor_lamp_zigbee_%d" % i, tradfri_light(mqtt_client, config.TOPIC_FFE_LIVINGROOM_FLOOR_LAMP_ZIGBEE % i, True, True, True))
|
|
188
|
+ self.gui_floor_lamp = gui_light(mqtt_client, config.TOPIC_FFE_LIVINGROOM_FLOOR_LAMP_GUI, True, True, True)
|
|
189
|
+ if config.CHRISTMAS:
|
|
190
|
+ self.xmas_tree = silvercrest_powerplug(mqtt_client, config.TOPIC_FFE_LIVINGROOM_XMAS_TREE_POWERPLUG)
|
|
191
|
+ self.xmas_tree.add_channel_name(silvercrest_powerplug, "Xmas-Tree")
|
|
192
|
+ self.gui_xmas_tree = gui_light(mqtt_client, config.TOPIC_FFE_LIVINGROOM_XMAS_TREE_GUI)
|
|
193
|
+ self.xmas_star = silvercrest_powerplug(mqtt_client, config.TOPIC_FFE_LIVINGROOM_XMAS_STAR_POWERPLUG)
|
|
194
|
+ self.xmas_star.add_channel_name(silvercrest_powerplug, "Xmas-Star")
|
193
|
195
|
|
194
|
196
|
|
195
|
197
|
class ffe(base):
|
|
@@ -203,7 +205,7 @@ class ffe(base):
|
203
|
205
|
|
204
|
206
|
class stairway(base):
|
205
|
207
|
def __init__(self, mqtt_client):
|
206
|
|
- self.gui_switch_main_light = gui_light(mqtt_client, config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_GUI_SWITCH, True, False, False)
|
|
208
|
+ self.gui_main_light = gui_light(mqtt_client, config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_GUI, True, False, False)
|
207
|
209
|
self.main_light = shelly(mqtt_client, config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_SHELLY, input_0_func=shelly.INPUT_FUNC_OUT1_TRIGGER)
|
208
|
210
|
self.main_light.add_channel_name(shelly.KEY_OUTPUT_0, "Main Light")
|
209
|
211
|
self.motion_sensor_gf = silvercrest_motion_sensor(mqtt_client, config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_MOTION_SENSOR_GF)
|