From 3a1e87283a89a9cebe6c4153bba621b79a863f34 Mon Sep 17 00:00:00 2001 From: astrinh0 Date: Wed, 25 Nov 2026 22:22:04 +0000 Subject: [PATCH] fix: recognize Lydos Hybrid permanent boost --- ariston/lydos_hybrid_device.py | 7 +++++++ tests/test_device_models.py | 20 ++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ariston/lydos_hybrid_device.py b/ariston/lydos_hybrid_device.py index 8c71128..9309686 100644 --- a/ariston/lydos_hybrid_device.py +++ b/ariston/lydos_hybrid_device.py @@ -40,6 +40,13 @@ def water_heater_mode(self) -> type[LydosPlantMode]: """Return the water heater mode class""" return LydosPlantMode + @property + def water_heater_current_mode_text(self) -> str: + """Get the current mode text, including the permanent boost readback.""" + if self.water_heater_mode_value == 8: + return LydosPlantMode.BOOST.name + return super().water_heater_current_mode_text + @property def max_setpoint_temp(self) -> str: return SeDeviceSettings.SE_MAX_SETPOINT_TEMPERATURE diff --git a/tests/test_device_models.py b/tests/test_device_models.py index e11676c..3d87b46 100644 --- a/tests/test_device_models.py +++ b/tests/test_device_models.py @@ -455,6 +455,17 @@ def test_nuos_split_green_plus_mode_is_exposed_and_settable(self): "gw-1", NuosSplitOperativeMode.GREEN_PLUS ) + def test_lydos_hybrid_reads_mode_8_as_boost(self): + device = self.make_device(AristonLydosHybridDevice) + + for mode, expected in ((1, "IMEMORY"), (7, "BOOST"), (8, "BOOST"), (99, "UNKNOWN")): + with self.subTest(mode=mode): + device.data[LydosDeviceProperties.MODE] = mode + self.assertEqual(device.water_heater_mode_value, mode) + self.assertEqual(device.water_heater_current_mode_text, expected) + + self.assertEqual(device.water_heater_mode_options, [1, 2, 6, 7]) + def test_lydos_hybrid_settings_accessors_and_all_commands(self): setting_keys = ( SeDeviceSettings.SE_MAX_SETPOINT_TEMPERATURE_MIN, @@ -522,7 +533,9 @@ def test_lydos_hybrid_settings_accessors_and_all_commands(self): with self.subTest(command=sync_name): getattr(device, sync_name)(value) if sync_name == "set_water_heater_operation_mode": - self.assertTrue(device.api.set_lydos_mode.called) + device.api.set_lydos_mode.assert_called_once_with( + "gw-1", LydosPlantMode.BOOST + ) elif sync_name == "set_water_heater_temperature": self.assertTrue(device.api.set_lydos_temperature.called) else: @@ -541,7 +554,10 @@ async def set_values(): await getattr(device, async_name)(value) asyncio.run(set_values()) - self.assertEqual(device.data[LydosDeviceProperties.MODE], LydosPlantMode.BOOST.value) + device.api.async_set_lydos_mode.assert_awaited_once_with( + "gw-1", LydosPlantMode.BOOST + ) + self.assertEqual(device.data[LydosDeviceProperties.MODE], 7) self.assertEqual(device.data[LydosDeviceProperties.REQ_TEMP], 55) self.assertEqual(device.api.async_set_velis_plant_setting.await_count, 6)