mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 20:55:10 +02:00
Fix uneeded state update in Idasen Desk sensor (#111433)
This commit is contained in:
@@ -91,10 +91,14 @@ class IdasenDeskSensor(CoordinatorEntity[IdasenDeskCoordinator], SensorEntity):
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""When entity is added to hass."""
|
||||
await super().async_added_to_hass()
|
||||
self._handle_coordinator_update()
|
||||
self._update_native_value()
|
||||
|
||||
@callback
|
||||
def _handle_coordinator_update(self, *args: Any) -> None:
|
||||
"""Handle data update."""
|
||||
self._attr_native_value = self.entity_description.value_fn(self.coordinator)
|
||||
self._update_native_value()
|
||||
super()._handle_coordinator_update()
|
||||
|
||||
def _update_native_value(self) -> None:
|
||||
"""Update the native value attribute."""
|
||||
self._attr_native_value = self.entity_description.value_fn(self.coordinator)
|
||||
|
Reference in New Issue
Block a user