Skip to content
Snippets Groups Projects
Commit 3e1f5b33 authored by jkerdreu's avatar jkerdreu
Browse files

- Added a method to find unknow DPS on powerrelays, smart-plugs ..


git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@3025 b32b6428-25c9-4566-ad07-03861ab6144f
parent 698a467a
No related branches found
No related tags found
No related merge requests found
......@@ -147,8 +147,20 @@ class SmartPlug(PowerRelay):
PowerRelay.setup(self)
# related power relays
pmeter.attributes['devices'] = [k.address for k in self.devices[1:]]
def debug_dps(self, dps):
k_dps = list(self.dps_to_dev.keys())
k_dps = k_dps + self.pmeter_dps
r = ''
for k,v in dps.items():
if k not in k_dps:
r = r + f"'{k}'->{v} "
if len(r) > 0:
logger.info(f"{self.tuya_id} unknow DPS: {r}")
def on_dps(self,dps):
if self.debug:
self.debug_dps(dps)
PowerRelay.on_dps(self,dps)
pmeter_attr = self.devices[0].attributes
# current
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment