diff --git a/devices/protocols/ZwaveJS/xaal/zwavejs/gw.py b/devices/protocols/ZwaveJS/xaal/zwavejs/gw.py index cef29476035e3d70aba181d6b20653422a643b5b..8923fbecfd88a176f9559468e1a02a373f131e05 100644 --- a/devices/protocols/ZwaveJS/xaal/zwavejs/gw.py +++ b/devices/protocols/ZwaveJS/xaal/zwavejs/gw.py @@ -51,12 +51,20 @@ class GW: for node in nodes.values(): if node.ready: logger.warning(f"{node.node_id} {node.device_config.manufacturer}/{node.device_config.label} ") + node.on("value updated", self.on_value_updated) for k in node.values: value = node.values.get(k) if value: print(f"{k} {value.property_name} => {value.value}") # pprint(node.data) + def on_value_updated(self, event): + cmd_class = event["args"]["commandClass"] + nodeId = event["nodeId"] + value = event["value"] + logger.warning(f"{nodeId}.{value.endpoint} {cmd_class}={value.property_key_name}=>{event["args"]["newValue"]}") + # print(event) + def setup(eng): GW(eng)