Skip to content

Commit

Permalink
feat: detect central ventilation devices (#451)
Browse files Browse the repository at this point in the history
* Update PyViCareDeviceConfig.py

* Update test_PyViCareDeviceConfig.py
  • Loading branch information
CFenner authored Nov 11, 2024
1 parent 1f89c3e commit 7cf8605
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions PyViCare/PyViCareDeviceConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def asAutoDetectDevice(self):
(self.asPelletsBoiler, r"Vitoligno|Ecotronic|VBC550P", []),
(self.asElectricalEnergySystem, r"E3_VitoCharge_03", ["type:ees"]),
(self.asVentilation, r"E3_ViAir", ["type:ventilation"]),
(self.asVentilation, r"E3_ViAir", ["type:ventilation;central"]),
(self.asVentilation, r"E3_VitoPure", ["type:ventilation;purifier"]),
(self.asRadiatorActuator, r"E3_RadiatorActuator", ["type:radiator"]),
(self.asRoomSensor, r"E3_RoomSensor", ["type:climateSensor"]),
Expand Down
8 changes: 7 additions & 1 deletion tests/test_PyViCareDeviceConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ def test_autoDetect_RoleVentilation_asVentilation(self):
device_type = c.asAutoDetectDevice()
self.assertEqual("VentilationDevice", type(device_type).__name__)

def test_autoDetect_Vitoair_FS_300E_asVentilation(self):
def test_autoDetect_RoleVentilationCentral_asVentilation(self):
self.service.hasRoles = has_roles(["type:ventilation;central"])
c = PyViCareDeviceConfig(self.service, "0", "Unknown", "Online")
device_type = c.asAutoDetectDevice()
self.assertEqual("VentilationDevice", type(device_type).__name__)

def test_autoDetect_Vitoair_FS_300F_asVentilation(self):
c = PyViCareDeviceConfig(self.service, "0", "E3_ViAir_300F", "Online")
device_type = c.asAutoDetectDevice()
self.assertEqual("VentilationDevice", type(device_type).__name__)
Expand Down

0 comments on commit 7cf8605

Please sign in to comment.