1
0
mirror of https://github.com/elisspace/core.git synced 2026-08-29 15:43:55 +00:00

Only write state if status has changed for shelly RPC devices

This commit is contained in:
J. Nick Koston
2023-03-12 16:05:46 -10:00
parent e575b7baa7
commit 0dbfbd88d1

View File

@@ -387,6 +387,8 @@ class ShellyRpcEntity(CoordinatorEntity[ShellyRpcCoordinator]):
@callback
def _update_callback(self) -> None:
"""Handle device update."""
# We will get callbacks whenever the device updates, but we only want to
# update state if the status key we care about has changed.
if self.status != self._last_status:
self._last_status = self.status
self.async_write_ha_state()