|
@@ -1,344 +0,0 @@
|
1
|
|
-
|
2
|
|
-#!/usr/bin/env python
|
3
|
|
-# -*- coding: utf-8 -*-
|
4
|
|
-#
|
5
|
|
-from devdi import props
|
6
|
|
-from devices import group
|
7
|
|
-import logging
|
8
|
|
-import sys
|
9
|
|
-
|
10
|
|
-try:
|
11
|
|
- from config import APP_NAME as ROOT_LOGGER_NAME
|
12
|
|
-except ImportError:
|
13
|
|
- ROOT_LOGGER_NAME = 'root'
|
14
|
|
-logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
|
15
|
|
-
|
16
|
|
-
|
17
|
|
-class base(dict):
|
18
|
|
- def __init__(self, mqtt_client):
|
19
|
|
- super().__init__(self)
|
20
|
|
-
|
21
|
|
- def add(self, mqtt_client, stg, loc, roo, fun, dty, num=None, ot=None):
|
22
|
|
- """Method to initilise a device
|
23
|
|
-
|
24
|
|
- Args:
|
25
|
|
- stg (numeric): Source transmittion group (see SIS_* in props)
|
26
|
|
- loc (numeric): Location (see LOC_* in props)
|
27
|
|
- roo (numeric): Room (see ROO_* in props)
|
28
|
|
- fun (numeric): Function (see FUN_* in props)
|
29
|
|
- dty (numeric): Device type (see DTP_* in props)
|
30
|
|
- num (numeric): Device number in case of multiple devices
|
31
|
|
- """
|
32
|
|
- def get_device(dty, mqtt_client, topic, ot):
|
33
|
|
- # Temporary to fit to current implementation
|
34
|
|
- if ot != topic:
|
35
|
|
- logger.error("Topic change for %s: Using this one: %s", topic, ot)
|
36
|
|
- topic = ot
|
37
|
|
- dev_class = props.dty_repr(dty)
|
38
|
|
- if dev_class is None:
|
39
|
|
- logger.warning('Device type %d is not yet implemented. Topic %s will not be supported.', dty, topic)
|
40
|
|
- else:
|
41
|
|
- return dev_class(mqtt_client, topic)
|
42
|
|
-
|
43
|
|
- topic = self.__topic__(stg, loc, roo, fun)
|
44
|
|
- if num is None:
|
45
|
|
- this_device = get_device(dty, mqtt_client, topic, ot)
|
46
|
|
- if this_device is None:
|
47
|
|
- logger.warning('Device type %d is not yet implemented. Topic %s will not be supported.', dty, topic)
|
48
|
|
- else:
|
49
|
|
- self[topic] = this_device
|
50
|
|
- else:
|
51
|
|
- dg = []
|
52
|
|
- for i in num:
|
53
|
|
- device_topic = self.__topic__(stg, loc, roo, fun) + '_%d' % i
|
54
|
|
- dg.append(get_device(dty, mqtt_client, device_topic, ot=ot % i))
|
55
|
|
- self[topic] = group(*dg)
|
56
|
|
-
|
57
|
|
- def get(self, stg, loc, roo, fun):
|
58
|
|
- """Method to get a device
|
59
|
|
-
|
60
|
|
- Args:
|
61
|
|
- stg (numeric): Source transmittion group (see SIS_* in props)
|
62
|
|
- loc (numeric): Location (see LOC_* in props)
|
63
|
|
- roo (numeric): Room (see ROO_* in props)
|
64
|
|
- fun (numeric): Function (see FUN_* in props)
|
65
|
|
- num (numeric): Device number in case of multiple devices
|
66
|
|
- """
|
67
|
|
- topic = self.__topic__(stg, loc, roo, fun)
|
68
|
|
- return self[topic]
|
69
|
|
-
|
70
|
|
- def __topic__(self, stg, loc, roo, fun):
|
71
|
|
- if stg in [props.STG_ZFE, props.STG_ZFW, props.STG_ZGW]:
|
72
|
|
- # Temporary to fit to current implementation
|
73
|
|
- return '/'.join([
|
74
|
|
- props.stg_repr(stg),
|
75
|
|
- props.roo_repr(roo),
|
76
|
|
- props.fun_repr(fun)
|
77
|
|
- ])
|
78
|
|
- else:
|
79
|
|
- return '/'.join([
|
80
|
|
- props.stg_repr(stg),
|
81
|
|
- props.loc_repr(loc),
|
82
|
|
- props.roo_repr(roo),
|
83
|
|
- props.fun_repr(fun)
|
84
|
|
- ])
|
85
|
|
-
|
86
|
|
-
|
87
|
|
-class physical_devices(base):
|
88
|
|
- """
|
89
|
|
- Class to create and store physical smarthome devices
|
90
|
|
- """
|
91
|
|
-
|
92
|
|
- def __init__(self, mqtt_client):
|
93
|
|
- super().__init__(self)
|
94
|
|
- self.__init_gfw__(mqtt_client)
|
95
|
|
- self.__init_ffw__(mqtt_client)
|
96
|
|
- self.__init_ffe__(mqtt_client)
|
97
|
|
- self.__init_stw__(mqtt_client)
|
98
|
|
-
|
99
|
|
- def __init_gfw__(self, mqtt_client):
|
100
|
|
- loc = props.LOC_GFW
|
101
|
|
-
|
102
|
|
- # MARION
|
103
|
|
- roo = props.ROO_MAR
|
104
|
|
- #
|
105
|
|
- # Temporary to fit to current implementation ###################################################
|
106
|
|
- TOPIC_GFW_MARION_MAIN_LIGHT_SHELLY = "shellies/gfw/marion/main_light"
|
107
|
|
- TOPIC_GFW_MARION_HEATING_VALVE_ZIGBEE = "zigbee/gfw/marion/heating_valve"
|
108
|
|
- # Temporary to fit to current implementation ###################################################
|
109
|
|
- self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1,
|
110
|
|
- ot=TOPIC_GFW_MARION_MAIN_LIGHT_SHELLY) # Shelly Main Light
|
111
|
|
- self.add(mqtt_client, props.STG_ZGW, loc, roo, props.FUN_HEA, props.DTY_BVL_xxx,
|
112
|
|
- ot=TOPIC_GFW_MARION_HEATING_VALVE_ZIGBEE) # Brennenstuhl Heatingvalve
|
113
|
|
-
|
114
|
|
- # FLOOR
|
115
|
|
- roo = props.ROO_FLO
|
116
|
|
- #
|
117
|
|
- # Temporary to fit to current implementation ###################################################
|
118
|
|
- TOPIC_GFW_FLOOR_MAIN_LIGHT_SHELLY = "shellies/gfw/floor/main_light"
|
119
|
|
- TOPIC_GFW_FLOOR_MAIN_LIGHT_ZIGBEE = "zigbee/gfw/floor/main_light_%d"
|
120
|
|
- # Temporary to fit to current implementation ###################################################
|
121
|
|
- self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1,
|
122
|
|
- ot=TOPIC_GFW_FLOOR_MAIN_LIGHT_SHELLY) # Shelly Main Light
|
123
|
|
- self.add(mqtt_client, props.STG_ZGW, loc, roo, props.FUN_MAL, props.DTY_LLI_SBT,
|
124
|
|
- range(1, 3), ot=TOPIC_GFW_FLOOR_MAIN_LIGHT_ZIGBEE) # Tradfri Main Light
|
125
|
|
-
|
126
|
|
- # DIRK
|
127
|
|
- roo = props.ROO_DIR
|
128
|
|
- #
|
129
|
|
- # Temporary to fit to current implementation ###################################################
|
130
|
|
- TOPIC_GFW_DIRK_MAIN_LIGHT_SHELLY = "shellies/gfw/dirk/main_light"
|
131
|
|
- TOPIC_GFW_DIRK_MAIN_LIGHT_ZIGBEE = "zigbee/gfw/dirk/main_light"
|
132
|
|
- TOPIC_GFW_DIRK_INPUT_DEVICE = "zigbee/gfw/dirk/input_device"
|
133
|
|
- TOPIC_GFW_DIRK_POWERPLUG = "my_apps/gfw/dirk/powerplug"
|
134
|
|
- TOPIC_GFW_DIRK_DESK_LIGHT_ZIGBEE = "zigbee/gfw/dirk/desk_light"
|
135
|
|
- TOPIC_GFW_DIRK_AMPLIFIER_REMOTE = "my_apps/gfw/dirk/remote/RAS5"
|
136
|
|
- TOPIC_GFW_DIRK_SPOTIFY = "my_apps/gfw/dirk/hifi/spotify"
|
137
|
|
- TOPIC_GFW_DIRK_MPD = "my_apps/gfw/dirk/hifi/mpd"
|
138
|
|
- TOPIC_GFW_DIRK_HEATING_VALVE_ZIGBEE = "zigbee/gfw/dirk/heating_valve"
|
139
|
|
- # Temporary to fit to current implementation ###################################################
|
140
|
|
- self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1,
|
141
|
|
- ot=TOPIC_GFW_DIRK_MAIN_LIGHT_SHELLY) # Shelly Main Light
|
142
|
|
- self.add(mqtt_client, props.STG_ZGW, loc, roo, props.FUN_MAL, props.DTY_TLI_SBT,
|
143
|
|
- ot=TOPIC_GFW_DIRK_MAIN_LIGHT_ZIGBEE) # Tradfri Main Light
|
144
|
|
- self.add(mqtt_client, props.STG_ZGW, loc, roo, props.FUN_INP, props.DTY_TIN_5xx,
|
145
|
|
- ot=TOPIC_GFW_DIRK_INPUT_DEVICE) # Tradfri Input Device 5 Buttons
|
146
|
|
- self.add(mqtt_client, props.STG_MYA, loc, roo, props.FUN_MPP, props.DTY_MPP_4xx, ot=TOPIC_GFW_DIRK_POWERPLUG) # My 4 port Powerplug
|
147
|
|
- self.add(mqtt_client, props.STG_ZGW, loc, roo, props.FUN_DEL, props.DTY_TLI_SBT, ot=TOPIC_GFW_DIRK_DESK_LIGHT_ZIGBEE), # Tradfri Desklight
|
148
|
|
- self.add(mqtt_client, props.STG_MYA, loc, roo, props.FUN_RCA, props.DTY_MRE_xxx,
|
149
|
|
- ot=TOPIC_GFW_DIRK_AMPLIFIER_REMOTE) # Remote Control IR Amplifier
|
150
|
|
- self.add(mqtt_client, props.STG_MYA, loc, roo, props.FUN_ASS, props.DTY_MAS_xxx, ot=TOPIC_GFW_DIRK_SPOTIFY) # Audio status Spotify
|
151
|
|
- self.add(mqtt_client, props.STG_MYA, loc, roo, props.FUN_ASM, props.DTY_MAS_xxx, ot=TOPIC_GFW_DIRK_MPD) # Audio status MPD
|
152
|
|
- self.add(mqtt_client, props.STG_ZGW, loc, roo, props.FUN_HEA, props.DTY_BVL_xxx,
|
153
|
|
- ot=TOPIC_GFW_DIRK_HEATING_VALVE_ZIGBEE) # Brennenstuhl Heatingvalve
|
154
|
|
-
|
155
|
|
- def __init_ffw__(self, mqtt_client):
|
156
|
|
- loc = props.LOC_FFW
|
157
|
|
- # JULIAN
|
158
|
|
- roo = props.ROO_JUL
|
159
|
|
- #
|
160
|
|
- # Temporary to fit to current implementation ###################################################
|
161
|
|
- TOPIC_FFW_JULIAN_MAIN_LIGHT_SHELLY = "shellies/ffw/julian/main_light"
|
162
|
|
- TOPIC_FFW_JULIAN_MAIN_LIGHT_ZIGBEE = "zigbee/ffw/julian/main_light"
|
163
|
|
- TOPIC_FFW_JULIAN_HEATING_VALVE_ZIGBEE = "zigbee/ffw/julian/heating_valve"
|
164
|
|
- # Temporary to fit to current implementation ###################################################
|
165
|
|
- self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1,
|
166
|
|
- ot=TOPIC_FFW_JULIAN_MAIN_LIGHT_SHELLY) # Shelly Main Light
|
167
|
|
- self.add(mqtt_client, props.STG_ZFW, loc, roo, props.FUN_MAL, props.DTY_TLI_SBT,
|
168
|
|
- ot=TOPIC_FFW_JULIAN_MAIN_LIGHT_ZIGBEE) # Tradfri Main Light
|
169
|
|
- self.add(mqtt_client, props.STG_ZFW, loc, roo, props.FUN_HEA, props.DTY_BVL_xxx,
|
170
|
|
- ot=TOPIC_FFW_JULIAN_HEATING_VALVE_ZIGBEE) # Brennenstuhl Heatingvalve
|
171
|
|
-
|
172
|
|
- # BATH
|
173
|
|
- roo = props.ROO_BAT
|
174
|
|
- #
|
175
|
|
- # Temporary to fit to current implementation
|
176
|
|
- # Temporary to fit to current implementation ###################################################
|
177
|
|
- TOPIC_FFW_BATH_HEATING_VALVE_ZIGBEE = "zigbee/ffw/bath/heating_valve"
|
178
|
|
- # Temporary to fit to current implementation ###################################################
|
179
|
|
- self.add(mqtt_client, props.STG_ZFW, loc, roo, props.FUN_HEA, props.DTY_BVL_xxx,
|
180
|
|
- ot=TOPIC_FFW_BATH_HEATING_VALVE_ZIGBEE) # Brennenstuhl Heatingvalve
|
181
|
|
-
|
182
|
|
- # LIVINGROOM
|
183
|
|
- roo = props.ROO_LIV
|
184
|
|
- #
|
185
|
|
- # Temporary to fit to current implementation ###################################################
|
186
|
|
- TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_SHELLY = "shellies/ffw/livingroom/main_light"
|
187
|
|
- TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_ZIGBEE = "zigbee/ffw/livingroom/main_light"
|
188
|
|
- # Temporary to fit to current implementation ###################################################
|
189
|
|
- self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1,
|
190
|
|
- ot=TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_SHELLY) # Shelly Main Light
|
191
|
|
- self.add(mqtt_client, props.STG_ZFW, loc, roo, props.FUN_MAL, props.DTY_TLI_SBT,
|
192
|
|
- ot=TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_ZIGBEE) # Tradfri Main Light
|
193
|
|
-
|
194
|
|
- # SLEEP
|
195
|
|
- roo = props.ROO_SLP
|
196
|
|
- #
|
197
|
|
- # Temporary to fit to current implementation ###################################################
|
198
|
|
- TOPIC_FFW_SLEEP_MAIN_LIGHT_SHELLY = "shellies/ffw/sleep/main_light"
|
199
|
|
- TOPIC_FFW_SLEEP_MAIN_LIGHT_ZIGBEE = "zigbee/ffw/sleep/main_light"
|
200
|
|
- TOPIC_FFW_SLEEP_HEATING_VALVE_ZIGBEE = "zigbee/ffw/sleep/heating_valve"
|
201
|
|
- # Temporary to fit to current implementation ###################################################
|
202
|
|
- self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1,
|
203
|
|
- ot=TOPIC_FFW_SLEEP_MAIN_LIGHT_SHELLY) # Shelly Main Light
|
204
|
|
- self.add(mqtt_client, props.STG_ZFW, loc, roo, props.FUN_MAL, props.DTY_TLI_SBx,
|
205
|
|
- ot=TOPIC_FFW_SLEEP_MAIN_LIGHT_ZIGBEE) # Tradfri Main Light
|
206
|
|
- self.add(mqtt_client, props.STG_ZFW, loc, roo, props.FUN_HEA, props.DTY_BVL_xxx,
|
207
|
|
- ot=TOPIC_FFW_SLEEP_HEATING_VALVE_ZIGBEE) # Brennenstuhl Heatingvalve
|
208
|
|
-
|
209
|
|
- def __init_ffe__(self, mqtt_client):
|
210
|
|
- loc = props.LOC_FFE
|
211
|
|
- # FLOOR
|
212
|
|
- roo = props.ROO_FLO
|
213
|
|
- #
|
214
|
|
- # Temporary to fit to current implementation ###################################################
|
215
|
|
- TOPIC_FFE_FLOOR_MAIN_LIGHT_SHELLY = "shellies/ffe/floor/main_light"
|
216
|
|
- # Temporary to fit to current implementation ###################################################
|
217
|
|
- self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1,
|
218
|
|
- ot=TOPIC_FFE_FLOOR_MAIN_LIGHT_SHELLY) # Shelly Main Light
|
219
|
|
-
|
220
|
|
- # KITCHEN
|
221
|
|
- roo = props.ROO_KIT
|
222
|
|
- #
|
223
|
|
- # Temporary to fit to current implementation ###################################################
|
224
|
|
- TOPIC_FFE_KITCHEN_MAIN_LIGHT_SHELLY = "shellies/ffe/kitchen/main_light"
|
225
|
|
- TOPIC_FFE_KITCHEN_CIRCULATION_PUMP_SHELLY = "shellies/ffe/kitchen/circulation_pump"
|
226
|
|
- TOPIC_FFE_KITCHEN_HEATING_VALVE_ZIGBEE = "zigbee/ffe/kitchen/heating_valve"
|
227
|
|
- # Temporary to fit to current implementation ###################################################
|
228
|
|
- self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1,
|
229
|
|
- ot=TOPIC_FFE_KITCHEN_MAIN_LIGHT_SHELLY) # Shelly Main Light
|
230
|
|
- self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_CIR, props.DTY_SHY_SW1,
|
231
|
|
- ot=TOPIC_FFE_KITCHEN_CIRCULATION_PUMP_SHELLY) # Shelly Main Light
|
232
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_HEA, props.DTY_BVL_xxx,
|
233
|
|
- ot=TOPIC_FFE_KITCHEN_HEATING_VALVE_ZIGBEE) # Brennenstuhl Heatingvalve
|
234
|
|
-
|
235
|
|
- # DININGROOM
|
236
|
|
- roo = props.ROO_DIN
|
237
|
|
- #
|
238
|
|
- # Temporary to fit to current implementation ###################################################
|
239
|
|
- TOPIC_FFE_DININGROOM_MAIN_LIGHT_SHELLY = "shellies/ffe/diningroom/main_light"
|
240
|
|
- TOPIC_FFE_DININGROOM_FLOOR_LAMP_POWERPLUG = "zigbee/ffe/diningroom/powerplug_floorlamp"
|
241
|
|
- TOPIC_FFE_DININGROOM_GARLAND_POWERPLUG = "zigbee/ffe/diningroom/garland"
|
242
|
|
- TOPIC_FFE_DININGROOM_HEATING_VALVE_ZIGBEE = "zigbee/ffe/diningroom/heating_valve"
|
243
|
|
- # Temporary to fit to current implementation ###################################################
|
244
|
|
- self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1,
|
245
|
|
- ot=TOPIC_FFE_DININGROOM_MAIN_LIGHT_SHELLY) # Shelly Main Light
|
246
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_FLL, props.DTY_SPP_SW1,
|
247
|
|
- ot=TOPIC_FFE_DININGROOM_FLOOR_LAMP_POWERPLUG) # Powerplug Floor Light
|
248
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_GAR, props.DTY_SPP_SW1,
|
249
|
|
- ot=TOPIC_FFE_DININGROOM_GARLAND_POWERPLUG) # Powerplug Garland
|
250
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_HEA, props.DTY_BVL_xxx,
|
251
|
|
- ot=TOPIC_FFE_DININGROOM_HEATING_VALVE_ZIGBEE) # Brennenstuhl Heatingvalve
|
252
|
|
-
|
253
|
|
- # SLEEP
|
254
|
|
- roo = props.ROO_SLP
|
255
|
|
- #
|
256
|
|
- # Temporary to fit to current implementation ###################################################
|
257
|
|
- TOPIC_FFE_SLEEP_MAIN_LIGHT_SHELLY = "shellies/ffe/sleep/main_light"
|
258
|
|
- TOPIC_FFE_SLEEP_MAIN_LIGHT_ZIGBEE = "zigbee/ffe/sleep/main_light"
|
259
|
|
- TOPIC_FFE_SLEEP_INPUT_DEVICE = "zigbee/ffe/sleep/input_device"
|
260
|
|
- TOPIC_FFE_SLEEP_BED_LIGHT_DI_ZIGBEE = "zigbee/ffe/sleep/bed_light_di"
|
261
|
|
- TOPIC_FFE_SLEEP_BED_LIGHT_MA_POWERPLUG = "zigbee/ffe/sleep/bed_light_ma"
|
262
|
|
- TOPIC_FFE_SLEEP_HEATING_VALVE_ZIGBEE = "zigbee/ffe/sleep/heating_valve"
|
263
|
|
- # Temporary to fit to current implementation ###################################################
|
264
|
|
- self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1,
|
265
|
|
- ot=TOPIC_FFE_SLEEP_MAIN_LIGHT_SHELLY) # Shelly Main Light
|
266
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_MAL, props.DTY_TLI_SBT,
|
267
|
|
- ot=TOPIC_FFE_SLEEP_MAIN_LIGHT_ZIGBEE) # Tradfri Main Light
|
268
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_INP, props.DTY_TIN_5xx,
|
269
|
|
- ot=TOPIC_FFE_SLEEP_INPUT_DEVICE) # Tradfri Input Device 5 Buttons
|
270
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_BLD, props.DTY_TLI_SBx,
|
271
|
|
- ot=TOPIC_FFE_SLEEP_BED_LIGHT_DI_ZIGBEE) # Tradfri Bed Light Dirk
|
272
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_BLM, props.DTY_SPP_SW1,
|
273
|
|
- ot=TOPIC_FFE_SLEEP_BED_LIGHT_MA_POWERPLUG) # Powerplug Bed Light Marion
|
274
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_HEA, props.DTY_BVL_xxx,
|
275
|
|
- ot=TOPIC_FFE_SLEEP_HEATING_VALVE_ZIGBEE) # Brennenstuhl Heatingvalve
|
276
|
|
-
|
277
|
|
- # LIVINGROOM
|
278
|
|
- roo = props.ROO_LIV
|
279
|
|
- #
|
280
|
|
- # Temporary to fit to current implementation ###################################################
|
281
|
|
- TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_SHELLY = "shellies/ffe/livingroom/main_light"
|
282
|
|
- TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_ZIGBEE = "zigbee/ffe/livingroom/main_light"
|
283
|
|
- TOPIC_FFE_LIVINGROOM_FLOOR_LAMP_ZIGBEE = "zigbee/ffe/livingroom/floorlamp_%d"
|
284
|
|
- TOPIC_FFE_LIVINGROOM_XMAS_TREE_POWERPLUG = "zigbee/ffe/livingroom/powerplug_xmas-tree"
|
285
|
|
- TOPIC_FFE_LIVINGROOM_XMAS_STAR_POWERPLUG = "zigbee/ffe/livingroom/powerplug_xmas-star"
|
286
|
|
- TOPIC_FFE_LIVINGROOM_HEATING_VALVE_ZIGBEE = "zigbee/ffe/livingroom/heating_valve"
|
287
|
|
- # Temporary to fit to current implementation ###################################################
|
288
|
|
- self.add(mqtt_client, props.STG_SHE, loc, roo, props.FUN_MAL, props.DTY_SHY_SW1,
|
289
|
|
- ot=TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_SHELLY) # Shelly Main Light
|
290
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_MAL, props.DTY_TLI_SBT,
|
291
|
|
- ot=TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_ZIGBEE) # Tradfri Main Light
|
292
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_FLL, props.DTY_TLI_SBT,
|
293
|
|
- range(1, 7), ot=TOPIC_FFE_LIVINGROOM_FLOOR_LAMP_ZIGBEE) # Tradfri Main Light
|
294
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_XTR, props.DTY_SPP_SW1,
|
295
|
|
- ot=TOPIC_FFE_LIVINGROOM_XMAS_TREE_POWERPLUG) # Tradfri Main Light
|
296
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_XST, props.DTY_SPP_SW1,
|
297
|
|
- ot=TOPIC_FFE_LIVINGROOM_XMAS_STAR_POWERPLUG) # Tradfri Main Light
|
298
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, roo, props.FUN_HEA, props.DTY_BVL_xxx,
|
299
|
|
- ot=TOPIC_FFE_LIVINGROOM_HEATING_VALVE_ZIGBEE) # Brennenstuhl Heatingvalve
|
300
|
|
-
|
301
|
|
- def __init_stw__(self, mqtt_client):
|
302
|
|
- loc = props.LOC_STW
|
303
|
|
- # FLOOR
|
304
|
|
- #
|
305
|
|
- # Temporary to fit to current implementation ###################################################
|
306
|
|
- TOPIC_STW_STAIRWAY_MAIN_LIGHT_SHELLY = "shellies/stw/stairway/main_light"
|
307
|
|
- TOPIC_STW_STAIRWAY_MAIN_LIGHT_MOTION_SENSOR_FF = "zigbee/ffe/stairway/motion_sensor_ff"
|
308
|
|
- TOPIC_STW_STAIRWAY_MAIN_LIGHT_MOTION_SENSOR_GF = "zigbee/gfw/stairway/motion_sensor_gf"
|
309
|
|
- # Temporary to fit to current implementation ###################################################
|
310
|
|
- self.add(mqtt_client, props.STG_SHE, loc, props.ROO_STF, props.FUN_MAL, props.DTY_SHY_SW1,
|
311
|
|
- ot=TOPIC_STW_STAIRWAY_MAIN_LIGHT_SHELLY) # Shelly Main Light
|
312
|
|
- self.add(mqtt_client, props.STG_ZFE, loc, props.ROO_STF, props.FUN_MSE, props.DTY_SMS_xxx,
|
313
|
|
- ot=TOPIC_STW_STAIRWAY_MAIN_LIGHT_MOTION_SENSOR_FF) # Motion Sensor First Floor
|
314
|
|
- self.add(mqtt_client, props.STG_ZGW, loc, props.ROO_STG, props.FUN_MSE, props.DTY_SMS_xxx,
|
315
|
|
- ot=TOPIC_STW_STAIRWAY_MAIN_LIGHT_MOTION_SENSOR_GF) # Motion Sensor Ground Floor
|
316
|
|
-
|
317
|
|
-
|
318
|
|
-class videv_devices(base):
|
319
|
|
- """
|
320
|
|
- Class to create and store videv smarthome devices
|
321
|
|
- """
|
322
|
|
-
|
323
|
|
- def __init__(self, mqtt_client):
|
324
|
|
- super().__init__(self)
|
325
|
|
- self.__init_gfw__(mqtt_client)
|
326
|
|
- self.__init_ffw__(mqtt_client)
|
327
|
|
- self.__init_ffe__(mqtt_client)
|
328
|
|
- self.__init_stw__(mqtt_client)
|
329
|
|
-
|
330
|
|
- def __init_gfw__(self, mqtt_client):
|
331
|
|
- loc = props.LOC_GFW
|
332
|
|
- # TODO: Add devices
|
333
|
|
-
|
334
|
|
- def __init_ffw__(self, mqtt_client):
|
335
|
|
- loc = props.LOC_FFW
|
336
|
|
- # TODO: Add devices
|
337
|
|
-
|
338
|
|
- def __init_ffe__(self, mqtt_client):
|
339
|
|
- loc = props.LOC_FFE
|
340
|
|
- # TODO: Add devices
|
341
|
|
-
|
342
|
|
- def __init_stw__(self, mqtt_client):
|
343
|
|
- loc = props.LOC_STW
|
344
|
|
- # TODO: Add devices
|