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:
1 parent
b903bbc042
commit
01ce43ec7c
6 files changed
+12
-14
No files matched your search
@@ -6,7 +6,6 @@ at https://home-assistant.io/components/light.zha/
|
||||
"""
|
||||
import logging
|
||||
from homeassistant.components import light, zha
|
||||
from homeassistant.const import STATE_UNKNOWN
|
||||
import homeassistant.util.color as color_util
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -76,7 +75,7 @@ class Light(zha.Entity, light.Light):
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
"""Return true if entity is on."""
|
||||
if self._state == STATE_UNKNOWN:
|
||||
if self._state is None:
|
||||
return False
|
||||
return bool(self._state)
|
||||
|
||||
|
||||
Reference in new issue
Block a user