diff --git a/ariston/galevo_device.py b/ariston/galevo_device.py index 7307f9a..7b11ea6 100644 --- a/ariston/galevo_device.py +++ b/ariston/galevo_device.py @@ -31,6 +31,7 @@ _LOGGER = logging.getLogger(__name__) _MENU_ITEM_UNAVAILABLE_VALUES = frozenset({3276.0, 3276.7, -3276.8, -3277.0}) +_CH_RETURN_TEMP_UNAVAILABLE_VALUES = _MENU_ITEM_UNAVAILABLE_VALUES | {0.0} class AristonGalevoDevice(AristonDevice): @@ -816,7 +817,11 @@ def _is_menu_item_available(item: Optional[dict[str, Any]]) -> bool: if value is None: return False try: - if float(value) in _MENU_ITEM_UNAVAILABLE_VALUES: + numeric_value = float(value) + unavailable_values = _MENU_ITEM_UNAVAILABLE_VALUES + if item.get("id") == MenuItemNames.CH_RETURN_TEMP.value: + unavailable_values = _CH_RETURN_TEMP_UNAVAILABLE_VALUES + if numeric_value in unavailable_values: return False except (TypeError, ValueError): pass diff --git a/pyproject.toml b/pyproject.toml index 30d3e36..1270258 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ dependencies = [ ] requires-python = ">=3.11" license = { file = "LICENSE" } -version = "0.19.16" +version = "0.19.17" dynamic = ['description'] [project.urls] diff --git a/tests/test_galevo_device.py b/tests/test_galevo_device.py index 000c410..e36b5e7 100644 --- a/tests/test_galevo_device.py +++ b/tests/test_galevo_device.py @@ -876,6 +876,24 @@ def test_heat_pump_menu_items_availability_getters_and_error_handling(self): device.menu_items = [] self.assertIsNone(device.hp_mode_value) + def test_zero_ch_return_temperature_is_unavailable_but_other_zero_values_are_valid(self): + device = self.make_device() + device.menu_items = [ + { + "id": MenuItemNames.CH_RETURN_TEMP.value, + PropertyType.VALUE: 0.0, + PropertyType.UNIT: "°C", + }, + { + "id": MenuItemNames.HP_OUTSIDE_AIR_TEMP.value, + PropertyType.VALUE: 0.0, + PropertyType.UNIT: "°C", + }, + ] + + self.assertIsNone(device.ch_return_temp_value) + self.assertEqual(device.hp_outside_air_temp_value, 0.0) + if __name__ == "__main__": unittest.main()