Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
fix: also sync HVAC and PRESET
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Claes committed Jun 12, 2020
1 parent 9c1cb79 commit 6716ab0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions custom_components/climate_group/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,18 @@ async def _async_master_changed(self, entity_id, old_state, new_state):
command[ATTR_TARGET_TEMP_HIGH] = new_state.attributes.get(
ATTR_TARGET_TEMP_HIGH
)

await self.async_set_temperature(command)


if old_state.state != new_state.state:
await self.async_set_hvac_mode({HVAC_MODES: new_state.state}})


if old_state.attributes.get(ATTR_PRESET_MODES) != new_state.attributes.get(
ATTR_PRESET_MODES
):
command[ATTR_TEMPERATURE] = new_state.attributes.get(ATTR_TEMPERATURE)

await self.async_set_preset_mode(command)
await self.async_set_preset_mode({ATTR_PRESET_MODES: new_state.attributes.get(ATTR_TEMPERATURE)}})

@property
def name(self) -> str:
Expand Down

0 comments on commit 6716ab0

Please sign in to comment.