Skip to content

Commit

Permalink
chore: add name to log line
Browse files Browse the repository at this point in the history
  • Loading branch information
chemelli74 committed Jul 11, 2024
1 parent 0e1c411 commit a720057
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion custom_components/midea_ac_lan/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def set_preset_mode(self, preset_mode: str) -> None:
def update_state(self, status: Any) -> None: # noqa: ANN401, ARG002
"""Midea Climate update state."""
if not self.hass:
_LOGGER.error("Climate update_state self: %s", type(self))
_LOGGER.error("Climate update_state for %s [%s]", self.name, type(self))
self.schedule_update_ha_state()


Expand Down
2 changes: 1 addition & 1 deletion custom_components/midea_ac_lan/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async def async_set_percentage(self, percentage: int) -> None:
def update_state(self, status: Any) -> None: # noqa: ANN401, ARG002
"""Midea Fan update state."""
if not self.hass:
_LOGGER.error("Fan update_state self: %s", type(self))
_LOGGER.error("Fan update_state for %s [%s]", self.name, type(self))
self.schedule_update_ha_state()


Expand Down
2 changes: 1 addition & 1 deletion custom_components/midea_ac_lan/humidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def turn_off(self, **kwargs: Any) -> None: # noqa: ANN401, ARG002
def update_state(self, status: Any) -> None: # noqa: ANN401, ARG002
"""Midea Humidifier update state."""
if not self.hass:
_LOGGER.error("Humidifier update_state self: %s", type(self))
_LOGGER.error("Humidifier update_state for %s [%s]", self.name, type(self))
self.schedule_update_ha_state()


Expand Down
2 changes: 1 addition & 1 deletion custom_components/midea_ac_lan/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,5 @@ def turn_off(self, **kwargs: Any) -> None: # noqa: ANN401, ARG002
def update_state(self, status: Any) -> None: # noqa: ANN401,ARG002
"""Midea Light update state."""
if not self.hass:
_LOGGER.error("Light update_state self: %s", type(self))
_LOGGER.error("Light update_state for %s [%s]", self.name, type(self))
self.schedule_update_ha_state()
7 changes: 6 additions & 1 deletion custom_components/midea_ac_lan/midea_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ def icon(self) -> str:
def update_state(self, status: Any) -> None: # noqa: ANN401
"""Update entity state."""
if not self.hass:
_LOGGER.error("Midea entity update_state self: %s", type(self))
_LOGGER.error(
"Midea entity update_state for %s [%s] with status %s",
self.name,
type(self),
status,
)
if self._entity_key in status or "available" in status:
self.schedule_update_ha_state()
6 changes: 5 additions & 1 deletion custom_components/midea_ac_lan/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ 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."""
if not self.hass:
_LOGGER.error("Water heater update_state self: %s", type(self))
_LOGGER.error(
"Water heater update_state for %s [%s]",
self.name,
type(self),
)
self.schedule_update_ha_state()


Expand Down

0 comments on commit a720057

Please sign in to comment.