Skip to content

Commit

Permalink
Expose current "follow me" state in extra entity attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
mill1000 committed Nov 1, 2023
1 parent 1360074 commit 22fba23
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions custom_components/midea_ac/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,18 @@ def should_poll(self) -> bool:
"""Poll the appliance for changes, there is no notification capability in the Midea API"""
return not self._use_fan_only_workaround

@property
def extra_state_attributes(self) -> dict[str, str]:
"""Return device specific state attributes."""

state_attributes = {}

if hasattr(self._device, "follow_me"):
state_attributes[_ATTR_FOLLOW_ME] = getattr(
self._device, "follow_me")

return state_attributes

async def async_set_follow_me(self, enabled) -> None:
"""Set 'follow me' mode."""
self._device.follow_me = enabled
Expand Down

0 comments on commit 22fba23

Please sign in to comment.