Report unavailability for yolink sensor and binary_sensor (#100743)

This commit is contained in:
hlyi 2023-10-01 06:21:26 -05:00 committed by GitHub
parent fd1f0b0efe
commit 9306e60530
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 2 deletions

View file

@ -136,3 +136,8 @@ class YoLinkBinarySensorEntity(YoLinkEntity, BinarySensorEntity):
state.get(self.entity_description.state_key)
)
self.async_write_ha_state()
@property
def available(self) -> bool:
"""Return true is device is available."""
return super().available and self.coordinator.dev_online