diff --git a/PyViCare/PyViCareVentilationDevice.py b/PyViCare/PyViCareVentilationDevice.py index 39bd586c..3a8b4141 100644 --- a/PyViCare/PyViCareVentilationDevice.py +++ b/PyViCare/PyViCareVentilationDevice.py @@ -74,6 +74,10 @@ def deactivateProgram(self, program): """ return self.service.setProperty(f"ventilation.operating.programs.{program}", "deactivate", {}) + @handleNotSupported + def getPermanentLevels(self) -> list[str]: + return list[str](self.service.getProperty("ventilation.operating.modes.permanent")["commands"]["setLevel"]["params"]["level"]["constraints"]["enum"]) + @handleAPICommandErrors def setPermanentLevel(self, level: str): return self.service.setProperty("ventilation.operating.modes.permanent", "setLevel", {'level': level}) diff --git a/tests/test_VitoairFs300E.py b/tests/test_VitoairFs300E.py index 79362da6..58648a5f 100644 --- a/tests/test_VitoairFs300E.py +++ b/tests/test_VitoairFs300E.py @@ -32,6 +32,10 @@ def test_getAvailablePrograms(self): expected_programs = ['standby'] self.assertListEqual(self.device.getAvailablePrograms(), expected_programs) + def test_getPermanentLevels(self): + expected_levels = ['levelOne', 'levelTwo', 'levelThree', 'levelFour'] + self.assertListEqual(expected_levels, self.device.getPermanentLevels()) + def test_getSchedule(self): keys = ['active', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'] self.assertListEqual(list(self.device.getSchedule().keys()), keys) diff --git a/tests/test_Vitopure350.py b/tests/test_Vitopure350.py index 936b9b5d..da8af80c 100644 --- a/tests/test_Vitopure350.py +++ b/tests/test_Vitopure350.py @@ -24,6 +24,10 @@ def test_getAvailablePrograms(self): expected_programs = ['standby'] self.assertListEqual(expected_programs, self.device.getAvailablePrograms()) + def test_getPermanentLevels(self): + expected_levels = ['levelOne', 'levelTwo', 'levelThree', 'levelFour'] + self.assertListEqual(expected_levels, self.device.getPermanentLevels()) + def test_getSchedule(self): keys = ['active', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'] self.assertListEqual(keys, list(self.device.getSchedule().keys()))