Remove duplicated available property from Shelly coordinator entities (#96859)
remove duplicated available propertypull/96872/head
parent
e29598ecaa
commit
36b4b5b887
|
@ -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:
|
||||||
|
|
|
@ -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."""
|
||||||
|
|
Loading…
Reference in New Issue