Remove duplicated available property from Shelly coordinator entities (#96859)

remove duplicated available property
pull/96872/head
Michael 2023-07-18 21:18:41 +02:00 committed by GitHub
parent e29598ecaa
commit 36b4b5b887
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 11 deletions

View File

@ -210,7 +210,7 @@ class BlockSleepingClimate(
"""Device availability.""" """Device availability."""
if self.device_block is not None: if self.device_block is not None:
return not cast(bool, self.device_block.valveError) return not cast(bool, self.device_block.valveError)
return self.coordinator.last_update_success return super().available
@property @property
def hvac_mode(self) -> HVACMode: def hvac_mode(self) -> HVACMode:

View File

@ -332,11 +332,6 @@ class ShellyBlockEntity(CoordinatorEntity[ShellyBlockCoordinator]):
) )
self._attr_unique_id = f"{coordinator.mac}-{block.description}" 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: async def async_added_to_hass(self) -> None:
"""When entity is added to HASS.""" """When entity is added to HASS."""
self.async_on_remove(self.coordinator.async_add_listener(self._update_callback)) 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_unique_id = f"{coordinator.mac}-{key}"
self._attr_name = get_rpc_entity_name(coordinator.device, key) self._attr_name = get_rpc_entity_name(coordinator.device, key)
@property
def available(self) -> bool:
"""Available."""
return self.coordinator.last_update_success
@property @property
def status(self) -> dict: def status(self) -> dict:
"""Device status by entity key.""" """Device status by entity key."""