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

@ -261,3 +261,8 @@ class YoLinkSensorEntity(YoLinkEntity, SensorEntity):
return
self._attr_native_value = attr_val
self.async_write_ha_state()
@property
def available(self) -> bool:
"""Return true is device is available."""
return super().available and self.coordinator.dev_online