Fix uneeded state update in Idasen Desk sensor (#111433)
This commit is contained in:
parent
bfd82a0780
commit
5a8779551b
1 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue