diff --git a/custom_components/plum_ecomax/entity.py b/custom_components/plum_ecomax/entity.py index f208103..55ae896 100644 --- a/custom_components/plum_ecomax/entity.py +++ b/custom_components/plum_ecomax/entity.py @@ -68,10 +68,12 @@ async def _async_set_available(value: Any = None) -> None: self._attr_available = True if description.key in self.device.data: - await _async_set_available() - await handler(self.device.get_nowait(description.key, None)) + value = self.device.get_nowait(description.key, None) + await _async_set_available(value) + await handler(value) + else: + self.device.subscribe_once(description.key, _async_set_available) - self.device.subscribe_once(description.key, _async_set_available) self.device.subscribe(description.key, handler) async def async_will_remove_from_hass(self) -> None: