|
@@ -26,8 +26,6 @@ class videv_switching(videv_base):
|
26
|
26
|
def __init__(self, mqtt_client, topic, sw_device, sw_key):
|
27
|
27
|
super().__init__(mqtt_client, topic)
|
28
|
28
|
self.add_routing(self.KEY_STATE, sw_device, sw_key)
|
29
|
|
- #
|
30
|
|
- self.__tx_capabilities__()
|
31
|
29
|
|
32
|
30
|
|
33
|
31
|
class videv_switching_timer(videv_base):
|
|
@@ -38,8 +36,6 @@ class videv_switching_timer(videv_base):
|
38
|
36
|
super().__init__(mqtt_client, topic)
|
39
|
37
|
self.add_routing(self.KEY_STATE, sw_device, sw_key)
|
40
|
38
|
self.add_display(self.KEY_TIMER, tm_device, tm_key)
|
41
|
|
- #
|
42
|
|
- self.__tx_capabilities__()
|
43
|
39
|
|
44
|
40
|
|
45
|
41
|
class videv_switching_motion(videv_base):
|
|
@@ -57,8 +53,6 @@ class videv_switching_motion(videv_base):
|
57
|
53
|
# motion sensor state
|
58
|
54
|
for index, motion_sensor in enumerate(self.motion_sensors):
|
59
|
55
|
self.add_display(self.KEY_MOTION_SENSOR % index, motion_sensor, motion_sensor.KEY_OCCUPANCY)
|
60
|
|
- #
|
61
|
|
- self.__tx_capabilities__()
|
62
|
56
|
|
63
|
57
|
|
64
|
58
|
class videv_switch_brightness(videv_base):
|
|
@@ -69,8 +63,6 @@ class videv_switch_brightness(videv_base):
|
69
|
63
|
super().__init__(mqtt_client, topic)
|
70
|
64
|
self.add_routing(self.KEY_STATE, sw_device, sw_key)
|
71
|
65
|
self.add_routing(self.KEY_BRIGHTNESS, br_device, br_key)
|
72
|
|
- #
|
73
|
|
- self.__tx_capabilities__()
|
74
|
66
|
|
75
|
67
|
|
76
|
68
|
class videv_switch_brightness_color_temp(videv_base):
|
|
@@ -83,8 +75,6 @@ class videv_switch_brightness_color_temp(videv_base):
|
83
|
75
|
self.add_routing(self.KEY_STATE, sw_device, sw_key)
|
84
|
76
|
self.add_routing(self.KEY_BRIGHTNESS, br_device, br_key)
|
85
|
77
|
self.add_routing(self.KEY_COLOR_TEMP, ct_device, ct_key)
|
86
|
|
- #
|
87
|
|
- self.__tx_capabilities__()
|
88
|
78
|
|
89
|
79
|
|
90
|
80
|
class videv_heating(videv_base):
|
|
@@ -111,8 +101,6 @@ class videv_heating(videv_base):
|
111
|
101
|
self.add_display(self.KEY_VALVE_TEMPERATURE_SETPOINT, heating_function, heating_function.KEY_TEMPERATURE_SETPOINT)
|
112
|
102
|
self.add_display(self.KEY_BOOST_TIMER, heating_function, heating_function.KEY_BOOST_TIMER)
|
113
|
103
|
self.add_display(self.KEY_TEMPERATURE, heating_function, heating_function.KEY_TEMPERATURE_CURRENT, False)
|
114
|
|
- #
|
115
|
|
- self.__tx_capabilities__()
|
116
|
104
|
|
117
|
105
|
|
118
|
106
|
class videv_multistate(videv_base):
|
|
@@ -126,14 +114,10 @@ class videv_multistate(videv_base):
|
126
|
114
|
self.__tx__(self.KEY_STATE % i, False)
|
127
|
115
|
#
|
128
|
116
|
device.add_callback(key_for_device, None, self.__index_rx__, True)
|
129
|
|
- #
|
130
|
|
- self.__tx_capabilities__()
|
131
|
117
|
|
132
|
118
|
def __index_rx__(self, device, key, data):
|
133
|
119
|
for i in range(0, self.num_states):
|
134
|
120
|
self.__tx__(self.KEY_STATE % i, i == data)
|
135
|
|
- #
|
136
|
|
- self.__tx_capabilities__()
|
137
|
121
|
|
138
|
122
|
|
139
|
123
|
class videv_audio_player(videv_base):
|
|
@@ -148,18 +132,10 @@ class videv_audio_player(videv_base):
|
148
|
132
|
#
|
149
|
133
|
for audio_device in args:
|
150
|
134
|
audio_device.add_callback(audio_device.KEY_TITLE, None, self.__title_rx__, True)
|
151
|
|
- #
|
152
|
|
- self.__tx_capabilities__()
|
153
|
135
|
|
154
|
136
|
def __title_rx__(self, device, key, data):
|
155
|
137
|
self.__tx__(self.KEY_TITLE, data or self.NO_TITLE)
|
156
|
138
|
|
157
|
|
- @property
|
158
|
|
- def capabilities(self):
|
159
|
|
- super().capabilities
|
160
|
|
- self.__capabilities__[self.KEY_TITLE] = {'display': True}
|
161
|
|
- return self.__capabilities__
|
162
|
|
-
|
163
|
139
|
|
164
|
140
|
class videv_warnings(videv_base):
|
165
|
141
|
MAX_WARNINGS = 10
|
|
@@ -188,8 +164,6 @@ class all_off(videv_base):
|
188
|
164
|
# register mqtt callbacks for all my keys
|
189
|
165
|
for key in self.__inst_dict__:
|
190
|
166
|
mqtt_client.add_callback(topic + "/" + key, self.all_off)
|
191
|
|
- #
|
192
|
|
- self.__tx_capabilities__()
|
193
|
167
|
|
194
|
168
|
def __check_inst_capabilities__(self, name, inst):
|
195
|
169
|
# fits to specified classes
|
|
@@ -220,14 +194,3 @@ class all_off(videv_base):
|
220
|
194
|
def all_off(self, client, userdata, message):
|
221
|
195
|
key = message.topic[len(self.topic) + 1:]
|
222
|
196
|
self.__inst_dict__[key].all_off()
|
223
|
|
- self.__tx_capabilities__()
|
224
|
|
-
|
225
|
|
- @property
|
226
|
|
- def capabilities(self):
|
227
|
|
- if self.__capabilities__ is None:
|
228
|
|
- self.__capabilities__ = {}
|
229
|
|
- self.__capabilities__['__type__'] = self.__class__.__name__
|
230
|
|
- for key in self.__inst_dict__:
|
231
|
|
- self.__capabilities__[key] = {}
|
232
|
|
- self.__capabilities__[key]['control'] = True
|
233
|
|
- return self.__capabilities__
|