From 36b4b5b887e38cd9fad1a5252f7d17da40b56b33 Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Tue, 18 Jul 2023 21:18:41 +0200 Subject: [PATCH] Remove duplicated available property from Shelly coordinator entities (#96859) remove duplicated available property --- homeassistant/components/shelly/climate.py | 2 +- homeassistant/components/shelly/entity.py | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/homeassistant/components/shelly/climate.py b/homeassistant/components/shelly/climate.py index 4cc5cacbde3..2027cf73d25 100644 --- a/homeassistant/components/shelly/climate.py +++ b/homeassistant/components/shelly/climate.py @@ -210,7 +210,7 @@ class BlockSleepingClimate( """Device availability.""" if self.device_block is not None: return not cast(bool, self.device_block.valveError) - return self.coordinator.last_update_success + return super().available @property def hvac_mode(self) -> HVACMode: diff --git a/homeassistant/components/shelly/entity.py b/homeassistant/components/shelly/entity.py index 9f95ea5ac21..548428c444c 100644 --- a/homeassistant/components/shelly/entity.py +++ b/homeassistant/components/shelly/entity.py @@ -332,11 +332,6 @@ class ShellyBlockEntity(CoordinatorEntity[ShellyBlockCoordinator]): ) self._attr_unique_id = f"{coordinator.mac}-{block.description}" - @property - def available(self) -> bool: - """Available.""" - return self.coordinator.last_update_success - async def async_added_to_hass(self) -> None: """When entity is added to HASS.""" self.async_on_remove(self.coordinator.async_add_listener(self._update_callback)) @@ -375,11 +370,6 @@ class ShellyRpcEntity(CoordinatorEntity[ShellyRpcCoordinator]): self._attr_unique_id = f"{coordinator.mac}-{key}" self._attr_name = get_rpc_entity_name(coordinator.device, key) - @property - def available(self) -> bool: - """Available.""" - return self.coordinator.last_update_success - @property def status(self) -> dict: """Device status by entity key."""