Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions ariston/nuos_split_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,14 @@ async def async_set_water_heater_reduced_temperature(self, temperature: float):
def set_water_heater_operation_mode(self, operation_mode: str):
"""Set water heater operation mode"""
self.api.set_nuos_mode(self.gw, NuosSplitOperativeMode[operation_mode])
self.data[NuosSplitProperties.MODE] = NuosSplitOperativeMode[
# The Nuos cloud payload exposes two distinct fields: `mode` (the
# plant mode shared with other Velis devices) and `opMode` (the
# operative mode specific to Nuos: GREEN / COMFORT / FAST / IMEMORY).
# `set_nuos_mode` posts to `/operativeMode`, so the server updates
# `opMode`. The `water_heater_mode_value` getter also reads `opMode`,
# so the optimistic cache update has to mirror that field, not the
# generic `mode`.
self.data[NuosSplitProperties.OP_MODE] = NuosSplitOperativeMode[
operation_mode
].value

Expand All @@ -184,7 +191,10 @@ async def async_set_water_heater_operation_mode(self, operation_mode: str):
await self.api.async_set_nuos_mode(
self.gw, NuosSplitOperativeMode[operation_mode]
)
self.data[NuosSplitProperties.MODE] = NuosSplitOperativeMode[
# See note in `set_water_heater_operation_mode`: the cloud
# /operativeMode endpoint updates `opMode`, which is also what the
# `water_heater_mode_value` getter reads.
self.data[NuosSplitProperties.OP_MODE] = NuosSplitOperativeMode[
operation_mode
].value

Expand Down