Skip to content

Commit

Permalink
chore: log only error of update_state
Browse files Browse the repository at this point in the history
  • Loading branch information
chemelli74 committed Jul 11, 2024
1 parent e2cc6ce commit 0e1c411
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion custom_components/midea_ac_lan/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ def set_preset_mode(self, preset_mode: str) -> None:

def update_state(self, status: Any) -> None: # noqa: ANN401, ARG002
"""Midea Climate update state."""
_LOGGER.debug("Climate update_state self: %s", type(self))
if not self.hass:
_LOGGER.error("Climate update_state self: %s", type(self))
self.schedule_update_ha_state()


Expand Down
3 changes: 2 additions & 1 deletion custom_components/midea_ac_lan/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ async def async_set_percentage(self, percentage: int) -> None:

def update_state(self, status: Any) -> None: # noqa: ANN401, ARG002
"""Midea Fan update state."""
_LOGGER.debug("Fan update_state self: %s", type(self))
if not self.hass:
_LOGGER.error("Fan update_state self: %s", type(self))
self.schedule_update_ha_state()


Expand Down
3 changes: 2 additions & 1 deletion custom_components/midea_ac_lan/humidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def turn_off(self, **kwargs: Any) -> None: # noqa: ANN401, ARG002

def update_state(self, status: Any) -> None: # noqa: ANN401, ARG002
"""Midea Humidifier update state."""
_LOGGER.debug("Humidifier update_state self: %s", type(self))
if not self.hass:
_LOGGER.error("Humidifier update_state self: %s", type(self))
self.schedule_update_ha_state()


Expand Down
3 changes: 2 additions & 1 deletion custom_components/midea_ac_lan/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,6 @@ def turn_off(self, **kwargs: Any) -> None: # noqa: ANN401, ARG002

def update_state(self, status: Any) -> None: # noqa: ANN401,ARG002
"""Midea Light update state."""
_LOGGER.debug("Light update_state self: %s", type(self))
if not self.hass:
_LOGGER.error("Light update_state self: %s", type(self))
self.schedule_update_ha_state()
3 changes: 2 additions & 1 deletion custom_components/midea_ac_lan/midea_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def icon(self) -> str:
@callback
def update_state(self, status: Any) -> None: # noqa: ANN401
"""Update entity state."""
_LOGGER.debug("Midea entity update_state self: %s", type(self))
if not self.hass:
_LOGGER.error("Midea entity update_state self: %s", type(self))
if self._entity_key in status or "available" in status:
self.schedule_update_ha_state()
3 changes: 2 additions & 1 deletion custom_components/midea_ac_lan/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ async def async_turn_off(self, **kwargs: Any) -> None: # noqa: ANN401

def update_state(self, status: Any) -> None: # noqa: ANN401, ARG002
"""Midea Water Heater update state."""
_LOGGER.debug("Water heater update_state self: %s", type(self))
if not self.hass:
_LOGGER.error("Water heater update_state self: %s", type(self))
self.schedule_update_ha_state()


Expand Down

0 comments on commit 0e1c411

Please sign in to comment.