Remove redudant state write in Smart Meter Texas (#154126)

This commit is contained in:
srirams
2025-10-11 03:32:10 -05:00
committed by GitHub
parent 0c9b72bf1d
commit a58a7065b6

View File

@@ -67,7 +67,7 @@ class SmartMeterTexasSensor(CoordinatorEntity, RestoreEntity, SensorEntity):
}
@callback
def _state_update(self):
def _handle_coordinator_update(self) -> None:
"""Call when the coordinator has an update."""
self._attr_available = self.coordinator.last_update_success
if self._attr_available:
@@ -77,7 +77,6 @@ class SmartMeterTexasSensor(CoordinatorEntity, RestoreEntity, SensorEntity):
async def async_added_to_hass(self) -> None:
"""Subscribe to updates."""
await super().async_added_to_hass()
self.async_on_remove(self.coordinator.async_add_listener(self._state_update))
# If the background update finished before
# we added the entity, there is no need to restore