Use None as initial state in zha component (#14389)
* Return None if state is unknown * Use None as initial state
This commit is contained in:
parent
b903bbc042
commit
01ce43ec7c
6 changed files with 12 additions and 14 deletions
|
@ -108,7 +108,7 @@ class BinarySensor(zha.Entity, BinarySensorDevice):
|
|||
@property
|
||||
def is_on(self) -> bool:
|
||||
"""Return True if entity is on."""
|
||||
if self._state == 'unknown':
|
||||
if self._state is None:
|
||||
return False
|
||||
return bool(self._state)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue