1
0
Fork 0
mirror of https://github.com/Andre0512/hon.git synced 2025-05-30 06:25:17 -04:00

Show controls always unavailable when diconnected

This commit is contained in:
Andre Basche 2023-05-13 22:09:41 +02:00
parent 593d3912af
commit 17d4d14ead
2 changed files with 11 additions and 2 deletions
custom_components/hon

View file

@ -67,7 +67,11 @@ class HonButtonEntity(HonEntity, ButtonEntity):
@property
def available(self) -> bool:
"""Return True if entity is available."""
return super().available and self._device.get("remoteCtrValid") == "1"
return (
super().available
and self._device.get("remoteCtrValid") == "1"
and self._device.get("attributes.lastConnEvent.category") != "DISCONNECTED"
)
class HonFeatureRequestButton(HonEntity, ButtonEntity):