From 5850ef46a3d5200e8c97aba43070b07a7116015a Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Tue, 21 Jul 2026 10:25:54 +0200 Subject: [PATCH 1/4] feat: add bypass support methods to VentilationDevice and corresponding tests --- PyViCare/PyViCareVentilationDevice.py | 12 ++++++++++++ tests/test_VitoairFs300E.py | 15 +++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/PyViCare/PyViCareVentilationDevice.py b/PyViCare/PyViCareVentilationDevice.py index bd2e20a0..7d34c417 100644 --- a/PyViCare/PyViCareVentilationDevice.py +++ b/PyViCare/PyViCareVentilationDevice.py @@ -282,6 +282,18 @@ def getSupplyFanTargetSpeed(self) -> int: def getHeatExchangerFrostProtectionActive(self) -> bool: return "off" != str(self.getProperty("ventilation.heatExchanger.frostprotection")["properties"]["status"]["value"]) + @handleNotSupported + def getBypassActive(self) -> bool: + return bool(self.getProperty("ventilation.bypass")["properties"]["active"]["value"]) + + @handleNotSupported + def getBypassPosition(self) -> int: + return int(self.getProperty("ventilation.bypass.position")["properties"]["value"]["value"]) + + @handleNotSupported + def getBypassAutomaticMode(self) -> bool: + return bool(self.getProperty("ventilation.bypass.operating.modes.automatic")["properties"]["active"]["value"]) + @handleNotSupported def getSupplyVolumeFlow(self) -> int: return int(self.getProperty("ventilation.volumeFlow.current.input")["properties"]["value"]["value"]) diff --git a/tests/test_VitoairFs300E.py b/tests/test_VitoairFs300E.py index 5ce84cfb..59bd7cd7 100644 --- a/tests/test_VitoairFs300E.py +++ b/tests/test_VitoairFs300E.py @@ -67,3 +67,18 @@ def test_getConfiguredLevelThreeVolumeFlow(self): def test_getConfiguredLevelFourVolumeFlow(self): self.assertEqual(self.device.getConfiguredLevelFourVolumeFlow(), 240) + + def test_getBypassActive(self): + service = ViCareServiceMock('response/VitoairFs300E_back.json') + device = VentilationDevice(service) + self.assertEqual(device.getBypassActive(), True) + + def test_getBypassPosition(self): + service = ViCareServiceMock('response/VitoairFs300E_back.json') + device = VentilationDevice(service) + self.assertEqual(device.getBypassPosition(), 0) + + def test_getBypassAutomaticMode(self): + service = ViCareServiceMock('response/VitoairFs300E_back.json') + device = VentilationDevice(service) + self.assertEqual(device.getBypassAutomaticMode(), True) From fc9cc276906863a35971bedcca22be35b57a4a48 Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Tue, 21 Jul 2026 13:26:37 +0200 Subject: [PATCH 2/4] refactor: simplify bypass tests to use existing device instance --- tests/test_VitoairFs300E.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/test_VitoairFs300E.py b/tests/test_VitoairFs300E.py index 31aa8fb9..e9de36ba 100644 --- a/tests/test_VitoairFs300E.py +++ b/tests/test_VitoairFs300E.py @@ -88,16 +88,10 @@ def test_getConfiguredLevelFourVolumeFlow(self): self.assertEqual(self.device.getConfiguredLevelFourVolumeFlow(), 275) def test_getBypassActive(self): - service = ViCareServiceMock('response/VitoairFs300E_back.json') - device = VentilationDevice(service) - self.assertEqual(device.getBypassActive(), True) + self.assertEqual(self.device.getBypassActive(), True) def test_getBypassPosition(self): - service = ViCareServiceMock('response/VitoairFs300E_back.json') - device = VentilationDevice(service) - self.assertEqual(device.getBypassPosition(), 0) + self.assertEqual(self.device.getBypassPosition(), 0) def test_getBypassAutomaticMode(self): - service = ViCareServiceMock('response/VitoairFs300E_back.json') - device = VentilationDevice(service) - self.assertEqual(device.getBypassAutomaticMode(), True) + self.assertEqual(self.device.getBypassAutomaticMode(), True) From e13b01914bcb4eda67d9eb23f95ee0210c46453d Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Tue, 21 Jul 2026 13:33:09 +0200 Subject: [PATCH 3/4] feat: add bypass operating mode methods and corresponding tests to VentilationDevice --- PyViCare/PyViCareVentilationDevice.py | 12 ++++++++++++ tests/test_VitoairFs300E.py | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/PyViCare/PyViCareVentilationDevice.py b/PyViCare/PyViCareVentilationDevice.py index c6669770..c4694db7 100644 --- a/PyViCare/PyViCareVentilationDevice.py +++ b/PyViCare/PyViCareVentilationDevice.py @@ -343,6 +343,18 @@ def getBypassPosition(self) -> int: def getBypassAutomaticMode(self) -> bool: return bool(self.getProperty("ventilation.bypass.operating.modes.automatic")["properties"]["active"]["value"]) + @handleNotSupported + def getBypassOperatingModeLevel(self) -> str: + return str(self.getProperty("ventilation.bypass.operating.modes.active")["properties"]["level"]["value"]) + + @handleNotSupported + def getBypassOperatingModeState(self) -> str: + return str(self.getProperty("ventilation.bypass.operating.modes.active")["properties"]["state"]["value"]) + + @handleNotSupported + def getBypassOperatingModeValue(self) -> str: + return str(self.getProperty("ventilation.bypass.operating.modes.active")["properties"]["value"]["value"]) + @handleNotSupported def getSupplyVolumeFlow(self) -> int: return int(self.getProperty("ventilation.volumeFlow.current.input")["properties"]["value"]["value"]) diff --git a/tests/test_VitoairFs300E.py b/tests/test_VitoairFs300E.py index e9de36ba..e9829eea 100644 --- a/tests/test_VitoairFs300E.py +++ b/tests/test_VitoairFs300E.py @@ -95,3 +95,12 @@ def test_getBypassPosition(self): def test_getBypassAutomaticMode(self): self.assertEqual(self.device.getBypassAutomaticMode(), True) + + def test_getBypassOperatingModeLevel(self): + self.assertEqual(self.device.getBypassOperatingModeLevel(), "dynamicRegulationMode") + + def test_getBypassOperatingModeState(self): + self.assertEqual(self.device.getBypassOperatingModeState(), "automatic") + + def test_getBypassOperatingModeValue(self): + self.assertEqual(self.device.getBypassOperatingModeValue(), "automatic") From 494c43f52680219278843c4e65ef0c30e9059a5b Mon Sep 17 00:00:00 2001 From: Nico Orschel Date: Tue, 21 Jul 2026 16:08:49 +0200 Subject: [PATCH 4/4] fix: correct spacing in test_getConfiguredLevelFourVolumeFlow --- tests/test_VitoairFs300E.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_VitoairFs300E.py b/tests/test_VitoairFs300E.py index e9829eea..0dd3fad4 100644 --- a/tests/test_VitoairFs300E.py +++ b/tests/test_VitoairFs300E.py @@ -86,7 +86,7 @@ def test_getConfiguredLevelThreeVolumeFlow(self): def test_getConfiguredLevelFourVolumeFlow(self): self.assertEqual(self.device.getConfiguredLevelFourVolumeFlow(), 275) - + def test_getBypassActive(self): self.assertEqual(self.device.getBypassActive(), True)