Repository navigation
Fix NuosSplit operative mode changes (GREEN mode not working) #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -195,17 +195,21 @@ 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[ | ||
| old_value = self.water_heater_mode_value if self.water_heater_mode_value is not None else 1 | ||
| self.api.set_nuos_mode( | ||
| self.gw, NuosSplitOperativeMode[operation_mode], old_value | ||
| ) | ||
| self.data[NuosSplitProperties.OP_MODE] = NuosSplitOperativeMode[ | ||
| operation_mode | ||
| ].value | ||
|
|
||
| async def async_set_water_heater_operation_mode(self, operation_mode: str): | ||
| """Async set water heater operation mode""" | ||
| old_value = self.water_heater_mode_value if self.water_heater_mode_value is not None else 1 | ||
| await self.api.async_set_nuos_mode( | ||
| self.gw, NuosSplitOperativeMode[operation_mode] | ||
| self.gw, NuosSplitOperativeMode[operation_mode], old_value | ||
| ) | ||
| self.data[NuosSplitProperties.MODE] = NuosSplitOperativeMode[ | ||
| self.data[NuosSplitProperties.OP_MODE] = NuosSplitOperativeMode[ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please update |
||
| operation_mode | ||
| ].value | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid hardcoding
old=1when the cached mode is unknown. Nuos value 1 is COMFORT, so a newly created device or empty cache sends COMFORT as the previous value regardless of the device's actual mode; since this endpoint'soldfield is the previous mode, the write can be rejected. Fetch the current state before both writes or handle an unknown previous value explicitly.