summaryrefslogtreecommitdiff
path: root/include/py/homekit/mqtt/_config.py
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2024-02-17 02:48:57 +0300
committerEvgeny Zinoviev <me@ch1p.io>2024-02-17 02:48:57 +0300
commitb7f1d55c9b4de4d21b11e5615a5dc8be0d4e883c (patch)
treedf3cba57518e21590d579b014867611002d92de5 /include/py/homekit/mqtt/_config.py
parentc4ace358182d1f58724336714490e3caac6b60df (diff)
parent05c85757b8e2340441057d9ddfde2e9649ae8676 (diff)
Merge branch 'website-python-rewrite'
Diffstat (limited to 'include/py/homekit/mqtt/_config.py')
-rw-r--r--include/py/homekit/mqtt/_config.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/py/homekit/mqtt/_config.py b/include/py/homekit/mqtt/_config.py
index 4916d8a..8aa3bfe 100644
--- a/include/py/homekit/mqtt/_config.py
+++ b/include/py/homekit/mqtt/_config.py
@@ -92,6 +92,7 @@ class MqttNodesConfig(ConfigUnit):
'type': 'dict',
'schema': {
'module': {'type': 'string', 'required': True, 'allowed': ['si7021', 'dht12']},
+ 'legacy_payload': {'type': 'boolean', 'required': False, 'default': False},
'interval': {'type': 'integer'},
'i2c_bus': {'type': 'integer'},
'tcpserver': {
@@ -168,3 +169,15 @@ class MqttNodesConfig(ConfigUnit):
else:
resdict[name] = node
return reslist if only_names else resdict
+
+ def node_uses_legacy_temphum_data_payload(self, node_id: str) -> bool:
+ try:
+ return self.get_node(node_id)['temphum']['legacy_payload']
+ except KeyError:
+ return False
+
+ def node_uses_legacy_relay_power_payload(self, node_id: str) -> bool:
+ try:
+ return self.get_node(node_id)['relay']['legacy_topics']
+ except KeyError:
+ return False