Skip to content

Add Nuos Split plant mode (Manual / Program) - #203

Merged
astrinh0 merged 2 commits into
fustom:mainfrom
Sartog:nuos-split-plant-mode
Nov 24, 2026
Merged

astrinh0 merged 2 commits into
fustom:mainfrom
Sartog:nuos-split-plant-mode

Conversation

@Sartog

@Sartog Sartog commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Adds Manual / Program (plant mode) support for Velis Nuos Split, requested in fustom/ariston-remotethermo-home-assistant-v3#453.

Context

  • NuosSplitPlantMode (MANUAL=1, PROGRAM=2) was already defined but unused.
  • The cloud already reports it as mode in slpPlantData.
  • The R2 PlantHomeSlp/SetData envelope used for GREEN already carries viewModel.plantMode, but it was only echoed back.

Changes

  • _build_nuos_r2_payload(plant_data, op_mode=None, plant_mode=None): None keeps the current cloud value, so existing callers are unchanged.
  • set_nuos_plant_mode_via_r2 / async_set_nuos_plant_mode_via_r2: same login/read/retry flow as the GREEN write.
  • AristonNuosSplitDevice: water_heater_plant_mode_value, water_heater_plant_mode_text, water_heater_plant_mode_texts, set_water_heater_plant_mode / async_set_water_heater_plant_mode.
  • New tests in tests/test_nuos_plant_mode.py.

Behaviour
Plant mode and operative mode are independent, as in the official app. On a real device, Manual Comfort → Program shows "Program Comfort". Changing the plant mode keeps opMode, and changing opMode keeps the plant mode.

Not verified yet
The write has not been checked against the live cloud. Testing needs the companion integration PR plus a release of this library.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vn98CDwmeppfpaPgDUykC

Comment thread tests/test_nuos_plant_mode.py Outdated
api._r2_login = MagicMock() # type: ignore[method-assign]
api._r2_get_slp_plant_data = MagicMock(return_value=PLANT) # type: ignore[method-assign]
api._r2_post_set_data = MagicMock() # type: ignore[method-assign]
api.set_nuos_plant_mode_via_r2("gw-1", NuosSplitPlantMode.MANUAL)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixture already starts in MANUAL, so this test still passes if the sync setter ignores the requested mode. Could you request PROGRAM and assert that the POST targets gw-1, sends plantMode=2, and preserves opMode=1?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed in b3e58df: the sync test now requests PROGRAM and asserts a single POST to gw-1 with plantMode=2 and opMode=1 preserved.

Comment thread ariston/ariston_api.py
self._r2_login()
try:
plant_data = self._r2_get_slp_plant_data(gw_id)
except ConnectionException:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a retry test for both the sync and async plant-mode setters? Have the first read raise ConnectionException, then verify that the setter logs in again, rereads the plant data, and posts exactly once using the fresh values. The full suite still passes with both retry paths removed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added test_api_sync_retry_after_failed_read and test_api_async_retry_after_failed_read in b3e58df. The first read raises ConnectionException; the tests assert a second login, a reread, and exactly one POST built from the fresh plant data (the second read returns opMode=3 / comfortTemp=60 so stale values would fail). I checked that both tests fail when either retry path is removed, and that the sync/async tests fail if the requested mode is ignored.

@astrinh0
astrinh0 merged commit fe02c98 into fustom:main Nov 24, 2026
5 checks passed
@Sartog
Sartog deleted the nuos-split-plant-mode branch November 25, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants