diff --git a/PyViCare/PyViCareVentilationDevice.py b/PyViCare/PyViCareVentilationDevice.py index a232ce88..39bd586c 100644 --- a/PyViCare/PyViCareVentilationDevice.py +++ b/PyViCare/PyViCareVentilationDevice.py @@ -91,3 +91,15 @@ def getSchedule(self): "sat": properties["entries"]["value"]["sat"], "sun": properties["entries"]["value"]["sun"] } + + @handleNotSupported + def getVentilationDemand(self) -> str: + return str(self.service.getProperty("ventilation.operating.state")["properties"]["demand"]["value"]) + + @handleNotSupported + def getVentilationLevel(self) -> str: + return str(self.service.getProperty("ventilation.operating.state")["properties"]["level"]["value"]) + + @handleNotSupported + def getVentilationReason(self) -> str: + return str(self.service.getProperty("ventilation.operating.state")["properties"]["reason"]["value"]) diff --git a/tests/test_VitoairFs300E.py b/tests/test_VitoairFs300E.py index 7fb7991b..79362da6 100644 --- a/tests/test_VitoairFs300E.py +++ b/tests/test_VitoairFs300E.py @@ -38,3 +38,8 @@ def test_getSchedule(self): def test_getSerial(self): self.assertEqual(self.device.getSerial(), "################") + + def test_ventilationState(self): + self.assertEqual(self.device.getVentilationDemand(), "unknown") + self.assertEqual(self.device.getVentilationLevel(), "levelFour") + self.assertEqual(self.device.getVentilationReason(), "sensorOverride") diff --git a/tests/test_Vitopure350.py b/tests/test_Vitopure350.py index 9b32282b..936b9b5d 100644 --- a/tests/test_Vitopure350.py +++ b/tests/test_Vitopure350.py @@ -31,3 +31,8 @@ def test_getSchedule(self): def test_getSerial(self): with self.assertRaises(PyViCareNotSupportedFeatureError): self.device.getSerial() + + def test_ventilationState(self): + self.assertEqual(self.device.getVentilationDemand(), "unknown") + self.assertEqual(self.device.getVentilationLevel(), "unknown") + self.assertEqual(self.device.getVentilationReason(), "sensorDriven")