|
@@ -27,6 +27,8 @@ class base(mqtt_base):
|
27
|
27
|
RX_IGNORE_TOPICS = []
|
28
|
28
|
RX_IGNORE_KEYS = []
|
29
|
29
|
RX_FILTER_DATA_KEYS = []
|
|
30
|
+ #
|
|
31
|
+ CFG_DATA = {}
|
30
|
32
|
|
31
|
33
|
def __init__(self, mqtt_client, topic):
|
32
|
34
|
super().__init__(mqtt_client, topic, default_values=dict.fromkeys(self.RX_KEYS))
|
|
@@ -37,7 +39,15 @@ class base(mqtt_base):
|
37
|
39
|
#
|
38
|
40
|
self.add_callback(None, None, self.__state_logging__, on_change_only=True)
|
39
|
41
|
|
|
42
|
+ def __cfg_callback__(self, key, value):
|
|
43
|
+ if self.CFG_DATA.get(key) != value:
|
|
44
|
+ self.logger.warning("Differing configuration identified: %s=%s --> %s=%s",
|
|
45
|
+ repr(key), repr(value), repr(key), repr(self.CFG_DATA.get(key)))
|
|
46
|
+ self.send_command(key, self.CFG_DATA.get(key))
|
|
47
|
+
|
40
|
48
|
def set(self, key, data, block_callback=[]):
|
|
49
|
+ if key in self.CFG_DATA:
|
|
50
|
+ self.__cfg_callback__(key, data)
|
41
|
51
|
if key in self.RX_IGNORE_KEYS:
|
42
|
52
|
pass # ignore these keys
|
43
|
53
|
elif key in self.RX_KEYS:
|