mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-11 00:54:28 +05:00
fix ds2413
This commit is contained in:
@@ -253,7 +253,7 @@ class MegaOutPort(MegaPushEntity):
|
|||||||
return self._state == 'ON'
|
return self._state == 'ON'
|
||||||
elif val is not None:
|
elif val is not None:
|
||||||
val = val.get("value")
|
val = val.get("value")
|
||||||
if self.index and self.addr:
|
if self.index is not None and self.addr is not None:
|
||||||
if not isinstance(val, dict):
|
if not isinstance(val, dict):
|
||||||
self.mega.lg.warning(f'{self.entity_id}: {val} is not a dict')
|
self.mega.lg.warning(f'{self.entity_id}: {val} is not a dict')
|
||||||
return
|
return
|
||||||
@@ -268,7 +268,7 @@ class MegaOutPort(MegaPushEntity):
|
|||||||
else:
|
else:
|
||||||
self.mega.lg.warning(f'{self.entity_id}: {_val} has wrong length')
|
self.mega.lg.warning(f'{self.entity_id}: {_val} has wrong length')
|
||||||
return
|
return
|
||||||
elif self.index and self.addr is None:
|
elif self.index is not None and self.addr is None:
|
||||||
self.mega.lg.warning(f'{self.entity_id} does not has addr')
|
self.mega.lg.warning(f'{self.entity_id} does not has addr')
|
||||||
return
|
return
|
||||||
self.mega.lg.debug('%s.state = %s', self.entity_id, val)
|
self.mega.lg.debug('%s.state = %s', self.entity_id, val)
|
||||||
|
|||||||
Reference in New Issue
Block a user