mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-11 00:54:28 +05:00
fix bugs
This commit is contained in:
@@ -251,20 +251,20 @@ class MegaOutPort(MegaPushEntity):
|
||||
val = val.get("value")
|
||||
if self.index and self.addr:
|
||||
if not isinstance(val, dict):
|
||||
self.mega.lg.warning(f'{self} has wrong state: {val}')
|
||||
self.mega.lg.warning(f'{self.entity_id} has wrong state: {val}')
|
||||
return
|
||||
_val = val.get(self.addr)
|
||||
if not isinstance(val, str):
|
||||
self.mega.lg.warning(f'{self} has wrong state: {val}')
|
||||
self.mega.lg.warning(f'{self.entity_id} has wrong state: {val}')
|
||||
return
|
||||
_val = _val.split('/')
|
||||
if len(_val) >= 2:
|
||||
val = val[self.index]
|
||||
else:
|
||||
self.mega.lg.warning(f'{self} has wrong state: {val}')
|
||||
self.mega.lg.warning(f'{self.entity_id} has wrong state: {val}')
|
||||
return
|
||||
elif self.index and self.addr is None:
|
||||
self.mega.lg.warning(f'{self} does not has addr')
|
||||
self.mega.lg.warning(f'{self.entity_id} does not has addr')
|
||||
return
|
||||
|
||||
if not self.invert:
|
||||
|
||||
Reference in New Issue
Block a user