Skip to content

Commit

Permalink
Fixes #232 and #234
Browse files Browse the repository at this point in the history
  • Loading branch information
sander1988 committed Jun 30, 2024
1 parent 703a82f commit 4ff8afd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions custom_components/indego/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ async def refresh_state(self):
except Exception as exc:
update_failed = True
_LOGGER.warning("Mower state update failed, reason: %s", str(exc))
#_LOGGER.exception(exc)
self.set_online_state(False)

if self._shutdown:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/indego/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"codeowners": ["@jm-73", "@eavanvalkenburg", "@sander1988"],
"requirements": ["git+https://github.com/jm-73/[email protected]"],
"iot_class": "cloud_push",
"version": "5.7.0",
"version": "5.7.1",
"loggers": ["custom_components.indego", "pyIndego"]
}
}
8 changes: 8 additions & 0 deletions custom_components/indego/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ def __init__(self, entity_id, name, icon, attributes, device_info: DeviceInfo):
self._attr_connected_to_cloud = None
self._should_poll = False

@callback
def async_write_ha_state(self) -> None:
"""Prevent write state calls when the entity is disabled."""
if not self.enabled:
_LOGGER.debug("%s is disabled, preventing HA state update", self.entity_id)
return
super().async_write_ha_state()

@callback
def _schedule_immediate_update(self):
"""Schedule update."""
Expand Down

0 comments on commit 4ff8afd

Please sign in to comment.