Skip to content

Commit

Permalink
Merge pull request #238 from jm-73/develop
Browse files Browse the repository at this point in the history
Fixes #232 and #234
  • Loading branch information
sander1988 authored Jun 30, 2024
2 parents 703a82f + 4ff8afd commit d6bf786
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 d6bf786

Please sign in to comment.