|
| 1 | +from __future__ import annotations |
1 | 2 | from typing import Any, List |
2 | 3 | from deprecated import deprecated |
3 | 4 |
|
|
9 | 10 | class HeatPump(HeatingDevice, VentilationDevice): |
10 | 11 |
|
11 | 12 | @property |
12 | | - def compressors(self) -> List[Any]: |
13 | | - return list([self.getCompressor(x) for x in self.getAvailableCompressors()]) |
| 13 | + def compressors(self) -> List[Compressor]: |
| 14 | + return [self.getCompressor(x) for x in self.getAvailableCompressors()] |
14 | 15 |
|
15 | | - def getCompressor(self, compressor): |
| 16 | + def getCompressor(self, compressor) -> Compressor: |
16 | 17 | return Compressor(self, compressor) |
17 | 18 |
|
18 | 19 | @handleNotSupported |
19 | 20 | def getAvailableCompressors(self): |
20 | 21 | return self.getProperty("heating.compressors")["properties"]["enabled"]["value"] |
21 | 22 |
|
| 23 | + @property |
| 24 | + def condensors(self) -> List[Condensor]: |
| 25 | + return [self.getCondensor(x) for x in self.getAvailableCompressors()] |
| 26 | + |
| 27 | + def getCondensor(self, condensor) -> Condensor: |
| 28 | + return Condensor(self, condensor) |
| 29 | + |
| 30 | + @property |
| 31 | + def evaporators(self) -> List[Evaporator]: |
| 32 | + return [self.getEvaporator(x) for x in self.getAvailableCompressors()] |
| 33 | + |
| 34 | + def getEvaporator(self, evaporator) -> Evaporator: |
| 35 | + return Evaporator(self, evaporator) |
| 36 | + |
22 | 37 | @handleNotSupported |
23 | 38 | def getBufferMainTemperature(self): |
24 | 39 | return self.getProperty("heating.bufferCylinder.sensors.temperature.main")["properties"]['value']['value'] |
@@ -376,3 +391,97 @@ def getPowerConsumptionTotalThisYear(self) -> float: |
376 | 391 | @handleNotSupported |
377 | 392 | def getPowerConsumptionTotalUnit(self) -> str: |
378 | 393 | return str(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.total")["properties"]["year"]["unit"]) |
| 394 | + |
| 395 | + @handleNotSupported |
| 396 | + def getCompressorOutletPressureUnit(self) -> str: |
| 397 | + # Shows the unit of measurement of the outlet pressure. |
| 398 | + return str(self.getProperty(f"heating.compressors.{self.compressor}.sensors.pressure.outlet")["properties"]["value"]["unit"]) |
| 399 | + |
| 400 | + @handleNotSupported |
| 401 | + def getCompressorOutletPressure(self) -> float: |
| 402 | + # Shows the outlet pressure of the compressor. |
| 403 | + return float(self.getProperty(f"heating.compressors.{self.compressor}.sensors.pressure.outlet")["properties"]["value"]["value"]) |
| 404 | + |
| 405 | + @handleNotSupported |
| 406 | + def getCompressorInletPressureUnit(self) -> str: |
| 407 | + # Shows the unit of measurement of the inlet pressure. |
| 408 | + return str(self.getProperty(f"heating.compressors.{self.compressor}.sensors.pressure.inlet")["properties"]["value"]["unit"]) |
| 409 | + |
| 410 | + @handleNotSupported |
| 411 | + def getCompressorInletPressure(self) -> float: |
| 412 | + # Shows the inlet pressure of the compressor. |
| 413 | + return float(self.getProperty(f"heating.compressors.{self.compressor}.sensors.pressure.inlet")["properties"]["value"]["value"]) |
| 414 | + |
| 415 | + @handleNotSupported |
| 416 | + def getCompressorOutletTemperatureUnit(self) -> str: |
| 417 | + # Shows the unit of measurement of the outlet temperature. |
| 418 | + return str(self.getProperty(f"heating.compressors.{self.compressor}.sensors.temperature.outlet")["properties"]["value"]["unit"]) |
| 419 | + |
| 420 | + @handleNotSupported |
| 421 | + def getCompressorOutletTemperature(self) -> float: |
| 422 | + # Shows the outlet temperature of the compressor. |
| 423 | + return float(self.getProperty(f"heating.compressors.{self.compressor}.sensors.temperature.outlet")["properties"]["value"]["value"]) |
| 424 | + |
| 425 | + @handleNotSupported |
| 426 | + def getCompressorInletTemperatureUnit(self) -> str: |
| 427 | + # Shows the unit of measurement of the inlet temperature. |
| 428 | + return str(self.getProperty(f"heating.compressors.{self.compressor}.sensors.temperature.inlet")["properties"]["value"]["unit"]) |
| 429 | + |
| 430 | + @handleNotSupported |
| 431 | + def getCompressorInletTemperature(self) -> float: |
| 432 | + # Shows the inlet temperature of the compressor. |
| 433 | + return float(self.getProperty(f"heating.compressors.{self.compressor}.sensors.temperature.inlet")["properties"]["value"]["value"]) |
| 434 | + |
| 435 | + |
| 436 | +class Evaporator(HeatingDeviceWithComponent): |
| 437 | + |
| 438 | + @property |
| 439 | + def evaporator(self) -> str: |
| 440 | + return self.component |
| 441 | + |
| 442 | + @handleNotSupported |
| 443 | + def getEvaporatorLiquidTemperatureUnit(self) -> str: |
| 444 | + # Shows the unit of measurement of the liquid temperature of the evaporator. |
| 445 | + return str(self.getProperty(f"heating.evaporators.{self.evaporator}.sensors.temperature.liquid")["properties"]["value"]["unit"]) |
| 446 | + |
| 447 | + @handleNotSupported |
| 448 | + def getEvaporatorLiquidTemperature(self) -> float: |
| 449 | + # Shows the liquid temperature of the evaporator. |
| 450 | + return float(self.getProperty(f"heating.evaporators.{self.evaporator}.sensors.temperature.liquid")["properties"]["value"]["value"]) |
| 451 | + |
| 452 | + @handleNotSupported |
| 453 | + def getEvaporatorOverheatTemperatureUnit(self) -> str: |
| 454 | + # Shows the unit of measurement of the overheat temperature of the evaporator. |
| 455 | + return str(self.getProperty(f"heating.evaporators.{self.evaporator}.sensors.temperature.overheat")["properties"]["value"]["unit"]) |
| 456 | + |
| 457 | + @handleNotSupported |
| 458 | + def getEvaporatorOverheatTemperature(self) -> float: |
| 459 | + # Shows the overheat temperature of the evaporator. |
| 460 | + return float(self.getProperty(f"heating.evaporators.{self.evaporator}.sensors.temperature.overheat")["properties"]["value"]["value"]) |
| 461 | + |
| 462 | + |
| 463 | +class Condensor(HeatingDeviceWithComponent): |
| 464 | + |
| 465 | + @property |
| 466 | + def condensor(self) -> str: |
| 467 | + return self.component |
| 468 | + |
| 469 | + @handleNotSupported |
| 470 | + def getCondensorSubcoolingTemperatureUnit(self) -> str: |
| 471 | + # Shows the unit of measurement of the subcooling temperature of the condensor. |
| 472 | + return str(self.getProperty(f"heating.condensors.{self.condensor}.sensors.temperature.subcooling")["properties"]["value"]["unit"]) |
| 473 | + |
| 474 | + @handleNotSupported |
| 475 | + def getCondensorSubcoolingTemperature(self) -> float: |
| 476 | + # Shows the subcooling temperature of the condensor. |
| 477 | + return float(self.getProperty(f"heating.condensors.{self.condensor}.sensors.temperature.subcooling")["properties"]["value"]["value"]) |
| 478 | + |
| 479 | + @handleNotSupported |
| 480 | + def getCondensorLiquidTemperatureUnit(self) -> str: |
| 481 | + # Shows the unit of measurement of the liquid temperature of the condensor. |
| 482 | + return str(self.getProperty(f"heating.condensors.{self.condensor}.sensors.temperature.liquid")["properties"]["value"]["unit"]) |
| 483 | + |
| 484 | + @handleNotSupported |
| 485 | + def getCondensorLiquidTemperature(self) -> float: |
| 486 | + # Shows the liquid temperature of the condensor. |
| 487 | + return float(self.getProperty(f"heating.condensors.{self.condensor}.sensors.temperature.liquid")["properties"]["value"]["value"]) |
0 commit comments