Skip to content

Commit

Permalink
Fix uneeded state update in Idasen Desk sensor (#111433)
Browse files Browse the repository at this point in the history
  • Loading branch information
abmantis committed Feb 26, 2024
1 parent bfd82a0 commit 5a87795
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions homeassistant/components/idasen_desk/sensor.py
Expand Up @@ -91,10 +91,14 @@ def __init__(
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)

0 comments on commit 5a87795

Please sign in to comment.