Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions ariston/lydos_hybrid_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 18 additions & 2 deletions tests/test_device_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand All @@ -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)

Expand Down