Skip to content

Commit

Permalink
Fix high load
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Mamontov committed Feb 7, 2022
1 parent 5ef0ef2 commit b4b0332
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/systemd_manager/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "systemd_manager",
"name": "Systemd Manager",
"version": "1.0.0",
"version": "1.1.0",
"documentation": "https://github.com/dmamontov/hass-systemd-manager",
"issue_tracker": "https://github.com/dmamontov/hass-systemd-manager/issues",
"config_flow": true,
Expand Down
7 changes: 6 additions & 1 deletion custom_components/systemd_manager/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ async def async_added_to_hass(self) -> None:

@callback
def _schedule_immediate_update(self) -> None:
self.async_schedule_update_ha_state(True)
if (
self._is_available != self.service.is_available
or self._is_on != self.service.is_on
or self._extra != self.service.extra
):
self.async_schedule_update_ha_state(True)

async def will_remove_from_hass(self) -> None:
if self.unsub_update:
Expand Down

0 comments on commit b4b0332

Please sign in to comment.