diff --git a/custom_components/indego/__init__.py b/custom_components/indego/__init__.py index 7b85877..2bb435d 100644 --- a/custom_components/indego/__init__.py +++ b/custom_components/indego/__init__.py @@ -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: diff --git a/custom_components/indego/manifest.json b/custom_components/indego/manifest.json index 8695ae2..15c6b6e 100644 --- a/custom_components/indego/manifest.json +++ b/custom_components/indego/manifest.json @@ -7,6 +7,6 @@ "codeowners": ["@jm-73", "@eavanvalkenburg", "@sander1988"], "requirements": ["git+https://github.com/jm-73/pyIndego.git@3.2.0"], "iot_class": "cloud_push", - "version": "5.7.0", + "version": "5.7.1", "loggers": ["custom_components.indego", "pyIndego"] -} +} \ No newline at end of file diff --git a/custom_components/indego/mixins.py b/custom_components/indego/mixins.py index 9d22593..b6d5238 100644 --- a/custom_components/indego/mixins.py +++ b/custom_components/indego/mixins.py @@ -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."""