mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Guard for missing value (#45867)
* guard for missing value * update comment
This commit is contained in:
parent
c93fec34b3
commit
2e98cfb9ab
@ -92,7 +92,13 @@ class ZWaveBaseEntity(Entity):
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
"""Return entity availability."""
|
||||
return self.client.connected and bool(self.info.node.ready)
|
||||
return (
|
||||
self.client.connected
|
||||
and bool(self.info.node.ready)
|
||||
# a None value indicates something wrong with the device,
|
||||
# or the value is simply not yet there (it will arrive later).
|
||||
and self.info.primary_value.value is not None
|
||||
)
|
||||
|
||||
@callback
|
||||
def _value_changed(self, event_data: dict) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user