diff --git a/custom_components/midea_ac_lan/midea_entity.py b/custom_components/midea_ac_lan/midea_entity.py index 98ccaae..28ec3d5 100644 --- a/custom_components/midea_ac_lan/midea_entity.py +++ b/custom_components/midea_ac_lan/midea_entity.py @@ -91,10 +91,21 @@ def update_state(self, status: Any) -> None: # noqa: ANN401 """Update entity state.""" if not self.hass: _LOGGER.error( - "Midea entity update_state for %s [%s] with status %s", + "MideaEntity update_state for %s [%s] with status %s: HASS is None", self.name, type(self), status, ) + return + + if self.hass.is_stopping: + _LOGGER.debug( + "MideaEntity update_state for %s [%s] with status %s: HASS is stopping", + self.name, + type(self), + status, + ) + return + if self._entity_key in status or "available" in status: self.schedule_update_ha_state()