Handle missing value in all platforms of zwave_js (#46081)
This commit is contained in:
parent
fb68bf85ae
commit
242ff045b9
6 changed files with 41 additions and 14 deletions
|
@ -102,13 +102,7 @@ class ZWaveBaseEntity(Entity):
|
|||
@property
|
||||
def available(self) -> bool:
|
||||
"""Return entity availability."""
|
||||
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
|
||||
)
|
||||
return self.client.connected and bool(self.info.node.ready)
|
||||
|
||||
@callback
|
||||
def _value_changed(self, event_data: dict) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue