Skip to content

Commit 99904db

Browse files
authored
feat(fan): add new datapoints (#643)
* add new datapoints * add sensors for vitovent * adjust test case
1 parent d55918e commit 99904db

3 files changed

Lines changed: 66 additions & 5 deletions

File tree

PyViCare/PyViCareVentilationDevice.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,47 @@ def getVentilationSchedule(self):
213213
@deprecated(reason="renamed, use getVentilationSchedule", version="2.40.0")
214214
def getSchedule(self):
215215
return self.getVentilationSchedule()
216+
217+
@handleNotSupported
218+
def getOutsideTemperature(self) -> float:
219+
return float(self.getProperty("ventilation.sensors.temperature.outside")["properties"]["value"]["value"])
220+
221+
@handleNotSupported
222+
def getOutsideHumidity(self) -> int:
223+
return int(self.getProperty("ventilation.sensors.humidity.outdoor")["properties"]["value"]["value"])
224+
225+
@handleNotSupported
226+
def getSupplyTemperature(self) -> float:
227+
return float(self.getProperty("ventilation.sensors.temperature.supply")["properties"]["value"]["value"])
228+
229+
@handleNotSupported
230+
def getSupplyHumidity(self) -> int:
231+
return int(self.getProperty("ventilation.sensors.humidity.supply")["properties"]["value"]["value"])
232+
233+
@handleNotSupported
234+
def getVolatileOrganicCompounds(self) -> int:
235+
return int(self.getProperty("ventilation.sensors.volatileOrganicCompounds")["properties"]["value"]["value"])
236+
237+
@handleNotSupported
238+
def getSupplyFanHours(self) -> int:
239+
return int(self.getProperty("ventilation.fan.supply.runtime")["properties"]["value"]["value"])
240+
241+
@handleNotSupported
242+
def getSupplyFanSpeed(self) -> int:
243+
return int(self.getProperty("ventilation.fan.supply")["properties"]["current"]["value"])
244+
245+
@handleNotSupported
246+
def getSupplyFanTargetSpeed(self) -> int:
247+
return int(self.getProperty("ventilation.fan.supply")["properties"]["target"]["value"])
248+
249+
@handleNotSupported
250+
def getHeatExchangerFrostProtectionActive(self) -> bool:
251+
return "off" != str(self.getProperty("ventilation.heatExchanger.frostprotection")["properties"]["status"]["value"])
252+
253+
@handleNotSupported
254+
def getSupplyVolumeFlow(self) -> int:
255+
return int(self.getProperty("ventilation.volumeFlow.current.input")["properties"]["value"]["value"])
256+
257+
@handleNotSupported
258+
def getExhaustVolumeFlow(self) -> int:
259+
return int(self.getProperty("ventilation.volumeFlow.current.output")["properties"]["value"]["value"])

tests/test_TestForMissingProperties.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,13 @@ def test_missingProperties(self):
166166

167167
# ventilation - not yet used
168168
'ventilation.control.filterChange',
169-
'ventilation.fan.supply',
170-
'ventilation.fan.supply.runtime',
171169
'ventilation.filter.pollution.blocked',
172170
'ventilation.filter.runtime',
173171
'ventilation.sensors.airBorneDust.pm1',
174172
'ventilation.sensors.airBorneDust.pm10',
175173
'ventilation.sensors.airBorneDust.pm2d5',
176174
'ventilation.sensors.airBorneDust.pm4',
177175
'ventilation.sensors.airQuality',
178-
'ventilation.sensors.humidity.supply',
179-
'ventilation.sensors.temperature.supply',
180-
'ventilation.sensors.volatileOrganicCompounds',
181176
'ventilation.levels.levelOne',
182177
'ventilation.levels.levelTwo',
183178
'ventilation.levels.levelThree',
@@ -261,6 +256,11 @@ def test_unverifiedProperties(self):
261256
'heating.compressors.0.power.consumption.cooling',
262257
'heating.compressors.0.power.consumption.dhw',
263258
'heating.compressors.0.power.consumption.total',
259+
'ventilation.sensors.temperature.outside',
260+
'ventilation.sensors.humidity.outdoor',
261+
'ventilation.volumeFlow.current.input',
262+
'ventilation.volumeFlow.current.output',
263+
'ventilation.heatExchanger.frostprotection',
264264
]
265265

266266
all_features = self.read_all_features()

tests/test_Vitopure350.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,20 @@ def test_deactivateVentilationQuickmodeStandby(self):
7676
self.assertEqual(len(self.service.setPropertyData), 1)
7777
self.assertEqual(self.service.setPropertyData[0]['action'], 'deactivate')
7878
self.assertEqual(self.service.setPropertyData[0]['property_name'], 'ventilation.quickmodes.standby')
79+
80+
@unittest.skip("testdata missing")
81+
def test_getOutsideTemperature(self):
82+
self.assertEqual(self.device.getOutsideTemperature(), 15.0)
83+
self.assertEqual(self.device.getOutsideHumidity(), 15)
84+
85+
def test_getSupplyTemperature(self):
86+
self.assertEqual(self.device.getSupplyTemperature(), 20.8)
87+
self.assertEqual(self.device.getSupplyHumidity(), 59)
88+
89+
def test_getVolatileOrganicCompounds(self):
90+
self.assertEqual(self.device.getVolatileOrganicCompounds(), 148)
91+
92+
def test_getSupplyFanSpeed(self):
93+
self.assertEqual(self.device.getSupplyFanSpeed(), 555)
94+
self.assertEqual(self.device.getSupplyFanTargetSpeed(), 585)
95+
self.assertEqual(self.device.getSupplyFanHours(), 819)

0 commit comments

Comments
 (0)