Skip to content

Commit

Permalink
Fixed none preset on VRC700 turning off the system
Browse files Browse the repository at this point in the history
  • Loading branch information
signalkraft committed Feb 23, 2024
1 parent eb90a96 commit 5458dae
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions custom_components/mypyllant/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,15 +582,19 @@ async def async_set_preset_mode(self, preset_mode):
preset_mode (str): The new preset mode to set
"""
if self.zone.control_identifier.is_vrc700:
try:
# VRC700 presets map to operating modes instead of special functions
if preset_mode == PRESET_NONE:
# None can map to off or auto mode, if it's selected by the user we want auto
requested_mode = ZoneHeatingOperatingModeVRC700.AUTO
elif preset_mode in ZONE_PRESET_MAP_VRC700.values():
requested_mode = [
k for k, v in ZONE_PRESET_MAP_VRC700.items() if v == preset_mode
][0]
await self.set_zone_operating_mode(requested_mode)
except IndexError:
else:
raise ValueError(
f'Invalid preset mode, use one of {", ".join(set(ZONE_PRESET_MAP_VRC700.values()))}'
)
await self.set_zone_operating_mode(requested_mode)
else:
if preset_mode not in ZONE_PRESET_MAP:
raise ValueError(
Expand Down

0 comments on commit 5458dae

Please sign in to comment.