Mark Duotecno entities unavailable when tcp goes down (#114325)

When the tcp connection to the duotecno smartbox goes down, mark all entities as unavailable.
This commit is contained in:
Maikel Punie
2024-05-15 15:12:47 +02:00
committed by GitHub
parent 2a9d29c5f5
commit d5a1587b1c

View File

@@ -41,6 +41,11 @@ class DuotecnoEntity(Entity):
"""When a unit has an update."""
self.async_write_ha_state()
@property
def available(self) -> bool:
"""Available state for the unit."""
return self._unit.is_available()
_T = TypeVar("_T", bound="DuotecnoEntity")
_P = ParamSpec("_P")