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:
damarco authored and Martin Hjelmare committed 2018-05-12 14:41:44 +02:00
1 parent b903bbc042
commit 01ce43ec7c
6 files changed
+12 -14

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ class Switch(zha.Entity, SwitchDevice):
@property
def is_on(self) -> bool:
"""Return if the switch is on based on the statemachine."""
if self._state == 'unknown':
if self._state is None:
return False
return bool(self._state)