PyViCare 2.62.0__tar.gz → 2.63.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PKG-INFO +2 -1
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCare.py +2 -1
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareCachedServiceBase.py +19 -5
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareDeviceConfig.py +1 -1
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareHeatPump.py +24 -0
- pyvicare-2.63.0/PyViCare/PyViCareRoomControl.py +114 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/pyproject.toml +2 -2
- pyvicare-2.62.0/PyViCare/PyViCareRoomControl.py +0 -120
- {pyvicare-2.62.0 → pyvicare-2.63.0}/LICENSE +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/Feature.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareAbstractOAuthManager.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareBrowserOAuthManager.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareCachedService.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareCachedServiceViaGateway.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareDevice.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareElectricalEnergySystem.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareFloorHeating.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareFuelCell.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareGateway.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareGazBoiler.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareHeatCurveCalculation.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareHeatingDevice.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareHybrid.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareOAuthManager.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareOilBoiler.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCarePelletsBoiler.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareRadiatorActuator.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareRepeater.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareRoomSensor.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareService.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareServiceViaGateway.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareUtils.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareVentilationDevice.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/PyViCareWaterTreatment.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/PyViCare/__init__.py +0 -0
- {pyvicare-2.62.0 → pyvicare-2.63.0}/README.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyViCare
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.63.0
|
|
4
4
|
Summary: Library to communicate with the Viessmann ViCare API.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
License-File: LICENSE
|
|
@@ -20,6 +20,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.13
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
23
24
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
25
|
Requires-Dist: authlib (>1.2.0)
|
|
25
26
|
Requires-Dist: deprecated (>=1.3.0,<2.0.0)
|
|
@@ -72,7 +72,8 @@ class PyViCare:
|
|
|
72
72
|
|
|
73
73
|
SUPPORTED_DEVICE_TYPES = [
|
|
74
74
|
"heating", "zigbee", "vitoconnect", "electricityStorage",
|
|
75
|
-
"tcu", "ventilation", "roomControl",
|
|
75
|
+
"tcu", "ventilation", "roomControl", "systemController",
|
|
76
|
+
"outdoorUnit",
|
|
76
77
|
]
|
|
77
78
|
|
|
78
79
|
def __extract_all_devices(self):
|
|
@@ -27,6 +27,7 @@ class ViCareCachedServiceBase(ViCareService):
|
|
|
27
27
|
self._cacheDuration = cacheDuration
|
|
28
28
|
self._cache: Optional[dict] = None
|
|
29
29
|
self._cacheTime: Optional[datetime] = None
|
|
30
|
+
self._cacheError: Optional[Exception] = None
|
|
30
31
|
self._cacheLock = threading.Lock()
|
|
31
32
|
|
|
32
33
|
def getProperty(self, accessor: ViCareDeviceAccessor, property_name: str) -> Any:
|
|
@@ -52,33 +53,46 @@ class ViCareCachedServiceBase(ViCareService):
|
|
|
52
53
|
# see https://github.com/home-assistant/core/issues/67052
|
|
53
54
|
# we simply return the old cache in this case
|
|
54
55
|
self._cacheTime = ViCareTimer().now()
|
|
56
|
+
self._cacheError = None
|
|
55
57
|
|
|
56
58
|
try:
|
|
57
59
|
data = self._fetch_uncached(accessor)
|
|
60
|
+
if "data" not in data:
|
|
61
|
+
logger.error("Missing 'data' property when fetching data.")
|
|
62
|
+
raise PyViCareInvalidDataError(data)
|
|
58
63
|
except PyViCareNotPaidForError as e:
|
|
59
64
|
logger.error("Viessmann API denied access (PACKAGE_NOT_PAID_FOR). Features unavailable: %s", e)
|
|
60
65
|
if self._cache is not None:
|
|
61
66
|
return self._cache
|
|
62
|
-
|
|
67
|
+
self._cacheError = PyViCareNotSupportedFeatureError("PACKAGE_NOT_PAID_FOR")
|
|
68
|
+
raise self._cacheError
|
|
63
69
|
except (PyViCareDeviceCommunicationError, PyViCareInternalServerError) as e:
|
|
64
70
|
if self._cache is not None:
|
|
65
71
|
logger.warning("API error, returning stale cache: %s", e)
|
|
66
72
|
return self._cache
|
|
73
|
+
self._cacheError = e
|
|
74
|
+
raise
|
|
75
|
+
except Exception as e:
|
|
76
|
+
self._cacheError = e
|
|
67
77
|
raise
|
|
68
78
|
|
|
69
|
-
if "data" not in data:
|
|
70
|
-
logger.error("Missing 'data' property when fetching data.")
|
|
71
|
-
raise PyViCareInvalidDataError(data)
|
|
72
79
|
self._cache = data
|
|
80
|
+
elif self._cache is None and self._cacheError is not None:
|
|
81
|
+
# The fetch that opened this window failed and left nothing to
|
|
82
|
+
# read. Replaying its error keeps every other reader from
|
|
83
|
+
# spending a request of its own before the window is over. The
|
|
84
|
+
# traceback is dropped because the instance is shared.
|
|
85
|
+
raise self._cacheError.with_traceback(None) from None
|
|
73
86
|
return self._cache
|
|
74
87
|
|
|
75
88
|
def is_cache_invalid(self) -> bool:
|
|
76
|
-
return self.
|
|
89
|
+
return self._cacheTime is None or (ViCareTimer().now() - self._cacheTime).seconds > self._cacheDuration
|
|
77
90
|
|
|
78
91
|
def clear_cache(self):
|
|
79
92
|
with self._cacheLock:
|
|
80
93
|
self._cache = None
|
|
81
94
|
self._cacheTime = None
|
|
95
|
+
self._cacheError = None
|
|
82
96
|
|
|
83
97
|
def _fetch_uncached(self, accessor: ViCareDeviceAccessor) -> Any:
|
|
84
98
|
raise NotImplementedError
|
|
@@ -119,7 +119,7 @@ class PyViCareDeviceConfig:
|
|
|
119
119
|
(self.asPelletsBoiler, r"Vitoligno|Ecotronic|VBC550P", []),
|
|
120
120
|
(self.asOilBoiler, r"Vitoladens|Vitoradial|Vitorondens|VPlusH|V200KW2_6", []),
|
|
121
121
|
(self.asGazBoiler, r"Vitodens|VScotH|Vitocrossal|VDensH|Vitopend|VPendH|OT_Heating_System", ["type:boiler"]),
|
|
122
|
-
(self.asHeatPump, r"Vitocal|VBC70|V200WO1A|CU401B", ["type:heatpump"]),
|
|
122
|
+
(self.asHeatPump, r"Vitocal|VBC70|V200WO1A|CU401B|OBNG_SCU|OBNG_OCU", ["type:heatpump"]),
|
|
123
123
|
(self.asElectricalEnergySystem, r"E3_VitoCharge_03", ["type:ees"]), # ees, it this a typo?
|
|
124
124
|
(self.asElectricalEnergySystem, r"E3_VitoCharge_05", ["type:ess"]),
|
|
125
125
|
(self.asVentilation, r"E3_ViAir", ["type:ventilation"]),
|
|
@@ -677,6 +677,30 @@ class Compressor(HeatingDeviceWithComponent):
|
|
|
677
677
|
def getPowerConsumptionCoolingThisYear(self) -> float:
|
|
678
678
|
return float(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.cooling")["properties"]["year"]["value"][0])
|
|
679
679
|
|
|
680
|
+
@handleNotSupported
|
|
681
|
+
def getPowerConsumptionHeatingThisWeek(self) -> float:
|
|
682
|
+
return float(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.heating.week")["properties"]["value"]["value"])
|
|
683
|
+
|
|
684
|
+
@handleNotSupported
|
|
685
|
+
def getPowerConsumptionHeatingThisWeekUnit(self) -> str:
|
|
686
|
+
return str(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.heating.week")["properties"]["value"]["unit"])
|
|
687
|
+
|
|
688
|
+
@handleNotSupported
|
|
689
|
+
def getPowerConsumptionDHWThisWeek(self) -> float:
|
|
690
|
+
return float(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.dhw.week")["properties"]["value"]["value"])
|
|
691
|
+
|
|
692
|
+
@handleNotSupported
|
|
693
|
+
def getPowerConsumptionDHWThisWeekUnit(self) -> str:
|
|
694
|
+
return str(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.dhw.week")["properties"]["value"]["unit"])
|
|
695
|
+
|
|
696
|
+
@handleNotSupported
|
|
697
|
+
def getPowerConsumptionCoolingThisWeek(self) -> float:
|
|
698
|
+
return float(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.cooling.week")["properties"]["value"]["value"])
|
|
699
|
+
|
|
700
|
+
@handleNotSupported
|
|
701
|
+
def getPowerConsumptionCoolingThisWeekUnit(self) -> str:
|
|
702
|
+
return str(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.cooling.week")["properties"]["value"]["unit"])
|
|
703
|
+
|
|
680
704
|
@handleNotSupported
|
|
681
705
|
def getPowerConsumptionTotalThisYear(self) -> float:
|
|
682
706
|
return float(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.total")["properties"]["year"]["value"][0])
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from PyViCare.PyViCareDevice import Device
|
|
4
|
+
from PyViCare.PyViCareUtils import handleNotSupported
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class RoomControl(Device):
|
|
8
|
+
"""Viessmann RoomControl virtual device.
|
|
9
|
+
|
|
10
|
+
Exposes per-room sensor readings, setpoints and configuration flags
|
|
11
|
+
on the public IoT scope. All accessors are read-only; the API does
|
|
12
|
+
not return write commands for room features on this scope.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
@handleNotSupported
|
|
16
|
+
def getAvailableRoomIds(self) -> list[str]:
|
|
17
|
+
"""Return the list of room indices for which the API returns data.
|
|
18
|
+
|
|
19
|
+
IoT scope no longer exposes a `rooms` parent feature, so we scan
|
|
20
|
+
the full feature list for `rooms.<n>.*` prefixes and report the
|
|
21
|
+
unique numeric indices, sorted numerically.
|
|
22
|
+
"""
|
|
23
|
+
features = self.service.fetch_all_features(self.accessor).get("data", [])
|
|
24
|
+
ids = set()
|
|
25
|
+
pattern = re.compile(r"^rooms\.(\d+)\.")
|
|
26
|
+
for feature in features:
|
|
27
|
+
name = feature.get("feature", "")
|
|
28
|
+
match = pattern.match(name)
|
|
29
|
+
if match:
|
|
30
|
+
ids.add(match.group(1))
|
|
31
|
+
return sorted(ids, key=int)
|
|
32
|
+
|
|
33
|
+
# --- sensor readings ---
|
|
34
|
+
|
|
35
|
+
@handleNotSupported
|
|
36
|
+
def getRoomTemperature(self, room_id: str) -> float:
|
|
37
|
+
return float(self.getProperty(f"rooms.{room_id}.sensors.temperature")["properties"]["value"]["value"])
|
|
38
|
+
|
|
39
|
+
@handleNotSupported
|
|
40
|
+
def getRoomHumidity(self, room_id: str) -> float:
|
|
41
|
+
return float(self.getProperty(f"rooms.{room_id}.sensors.humidity")["properties"]["value"]["value"])
|
|
42
|
+
|
|
43
|
+
@handleNotSupported
|
|
44
|
+
def getRoomCO2(self, room_id: str) -> int:
|
|
45
|
+
return int(self.getProperty(f"rooms.{room_id}.co2")["properties"]["concentration"]["value"])
|
|
46
|
+
|
|
47
|
+
@handleNotSupported
|
|
48
|
+
def getRoomCondensationRisk(self, room_id: str) -> bool:
|
|
49
|
+
return bool(self.getProperty(f"rooms.{room_id}.condensationRisk")["properties"]["value"]["value"])
|
|
50
|
+
|
|
51
|
+
# --- temperature setpoints per program-level (°C) ---
|
|
52
|
+
|
|
53
|
+
@handleNotSupported
|
|
54
|
+
def getRoomSetpointComfortHeating(self, room_id: str) -> float:
|
|
55
|
+
return float(self.getProperty(f"rooms.{room_id}.temperature.levels.comfort.heating")["properties"]["temperature"]["value"])
|
|
56
|
+
|
|
57
|
+
@handleNotSupported
|
|
58
|
+
def getRoomSetpointNormalHeating(self, room_id: str) -> float:
|
|
59
|
+
return float(self.getProperty(f"rooms.{room_id}.temperature.levels.normal.heating")["properties"]["temperature"]["value"])
|
|
60
|
+
|
|
61
|
+
@handleNotSupported
|
|
62
|
+
def getRoomSetpointReducedHeating(self, room_id: str) -> float:
|
|
63
|
+
return float(self.getProperty(f"rooms.{room_id}.temperature.levels.reduced.heating")["properties"]["temperature"]["value"])
|
|
64
|
+
|
|
65
|
+
@handleNotSupported
|
|
66
|
+
def getRoomSetpointNormalCooling(self, room_id: str) -> float:
|
|
67
|
+
return float(self.getProperty(f"rooms.{room_id}.temperature.levels.normal.cooling")["properties"]["temperature"]["value"])
|
|
68
|
+
|
|
69
|
+
@handleNotSupported
|
|
70
|
+
def getRoomSetpointReducedCooling(self, room_id: str) -> float:
|
|
71
|
+
return float(self.getProperty(f"rooms.{room_id}.temperature.levels.reduced.cooling")["properties"]["temperature"]["value"])
|
|
72
|
+
|
|
73
|
+
@handleNotSupported
|
|
74
|
+
def getRoomSetpointNormalPerceived(self, room_id: str) -> float:
|
|
75
|
+
return float(self.getProperty(f"rooms.{room_id}.temperature.levels.normal.perceived")["properties"]["temperature"]["value"])
|
|
76
|
+
|
|
77
|
+
@handleNotSupported
|
|
78
|
+
def getRoomSetpointComfortPerceived(self, room_id: str) -> float:
|
|
79
|
+
return float(self.getProperty(f"rooms.{room_id}.temperature.levels.comfort.perceived")["properties"]["temperature"]["value"])
|
|
80
|
+
|
|
81
|
+
# --- room state flags ---
|
|
82
|
+
|
|
83
|
+
@handleNotSupported
|
|
84
|
+
def getRoomChildLockActive(self, room_id: str) -> bool:
|
|
85
|
+
return bool(self.getProperty(f"rooms.{room_id}.childLock")["properties"]["active"]["value"])
|
|
86
|
+
|
|
87
|
+
@handleNotSupported
|
|
88
|
+
def getRoomChildLockStatus(self, room_id: str) -> str:
|
|
89
|
+
return str(self.getProperty(f"rooms.{room_id}.childLock")["properties"]["status"]["value"])
|
|
90
|
+
|
|
91
|
+
@handleNotSupported
|
|
92
|
+
def getRoomWindowOpen(self, room_id: str) -> bool:
|
|
93
|
+
# Uses the modern `rooms.X.sensors.openWindow` feature; the legacy
|
|
94
|
+
# `rooms.X.sensors.window.openState` path is in the deprecation
|
|
95
|
+
# database (removal date 2024-09-15).
|
|
96
|
+
return bool(self.getProperty(f"rooms.{room_id}.sensors.openWindow")["properties"]["value"]["value"])
|
|
97
|
+
|
|
98
|
+
# --- room configuration flags (whether a feature is enabled, not its value) ---
|
|
99
|
+
|
|
100
|
+
@handleNotSupported
|
|
101
|
+
def getRoomOpenWindowDetectionEnabled(self, room_id: str) -> bool:
|
|
102
|
+
return bool(self.getProperty(f"rooms.{room_id}.configuration.openWindow")["properties"]["active"]["value"])
|
|
103
|
+
|
|
104
|
+
@handleNotSupported
|
|
105
|
+
def getRoomHydraulicBalancingEnabled(self, room_id: str) -> bool:
|
|
106
|
+
return bool(self.getProperty(f"rooms.{room_id}.configuration.hydraulicBalancing")["properties"]["value"]["value"])
|
|
107
|
+
|
|
108
|
+
@handleNotSupported
|
|
109
|
+
def getRoomTrvAlgorithmEnabled(self, room_id: str) -> bool:
|
|
110
|
+
return bool(self.getProperty(f"rooms.{room_id}.configuration.trvAlgorithmActive")["properties"]["value"]["value"])
|
|
111
|
+
|
|
112
|
+
@handleNotSupported
|
|
113
|
+
def getRoomHeatOnTimeEnabled(self, room_id: str) -> bool:
|
|
114
|
+
return bool(self.getProperty(f"rooms.{room_id}.configuration.heatOnTime")["properties"]["active"]["value"])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "PyViCare"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.63.0"
|
|
4
4
|
description = "Library to communicate with the Viessmann ViCare API."
|
|
5
5
|
authors = [
|
|
6
6
|
"Simon Gillet <mail+pyvicare@gillet.ninja>"
|
|
@@ -50,7 +50,7 @@ deprecated = "^1.3.0"
|
|
|
50
50
|
[tool.poetry.group.dev.dependencies]
|
|
51
51
|
codespell = "2.4.3"
|
|
52
52
|
mypy = "2.3.1"
|
|
53
|
-
pylint = "4.0.
|
|
53
|
+
pylint = "4.0.10"
|
|
54
54
|
pytest = "9.1.1"
|
|
55
55
|
pytest-cov = "7.1.0"
|
|
56
56
|
ruff = "0.15.22"
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
from typing import Any, cast
|
|
3
|
-
|
|
4
|
-
from PyViCare.PyViCareDevice import Device
|
|
5
|
-
from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError, handleNotSupported, handleAPICommandErrors
|
|
6
|
-
|
|
7
|
-
logger = logging.getLogger(__name__)
|
|
8
|
-
logger.addHandler(logging.NullHandler())
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class RoomControl(Device):
|
|
12
|
-
"""Viessmann RoomControl virtual device.
|
|
13
|
-
|
|
14
|
-
Aggregates room sensor data and heating programs per room.
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
@handleNotSupported
|
|
18
|
-
def getAvailableRooms(self) -> list[str]:
|
|
19
|
-
return cast(list[str], self.getProperty("rooms")["properties"]["enabled"]["value"])
|
|
20
|
-
|
|
21
|
-
def getRoomActorIds(self, room_id: str) -> list[str]:
|
|
22
|
-
"""Return list of actor device IDs for a room."""
|
|
23
|
-
try:
|
|
24
|
-
actors = self.getProperty(f"rooms.{room_id}")["properties"]["actors"]["value"]
|
|
25
|
-
return [str(a["deviceId"]) for a in actors]
|
|
26
|
-
except (PyViCareNotSupportedFeatureError, KeyError):
|
|
27
|
-
return []
|
|
28
|
-
|
|
29
|
-
def getRoomName(self, room_id: str) -> str | None:
|
|
30
|
-
try:
|
|
31
|
-
return str(self.getProperty(f"rooms.{room_id}")["properties"]["name"]["value"])
|
|
32
|
-
except (PyViCareNotSupportedFeatureError, KeyError):
|
|
33
|
-
return None
|
|
34
|
-
|
|
35
|
-
def getRoomType(self, room_id: str) -> str | None:
|
|
36
|
-
try:
|
|
37
|
-
return str(self.getProperty(f"rooms.{room_id}")["properties"]["type"]["value"])
|
|
38
|
-
except (PyViCareNotSupportedFeatureError, KeyError):
|
|
39
|
-
return None
|
|
40
|
-
|
|
41
|
-
# --- Sensors ---
|
|
42
|
-
|
|
43
|
-
def getRoomTemperature(self, room_id: str) -> float:
|
|
44
|
-
return float(self.getProperty(f"rooms.{room_id}.sensors.temperature")["properties"]["value"]["value"])
|
|
45
|
-
|
|
46
|
-
def getRoomHumidity(self, room_id: str) -> float:
|
|
47
|
-
return float(self.getProperty(f"rooms.{room_id}.sensors.humidity")["properties"]["value"]["value"])
|
|
48
|
-
|
|
49
|
-
def getRoomCO2(self, room_id: str) -> int:
|
|
50
|
-
return int(self.getProperty(f"rooms.{room_id}.sensors.co2")["properties"]["value"]["value"])
|
|
51
|
-
|
|
52
|
-
def getRoomCondensationRisk(self, room_id: str) -> bool:
|
|
53
|
-
return bool(self.getProperty(f"rooms.{room_id}.condensationRisk")["properties"]["value"]["value"])
|
|
54
|
-
|
|
55
|
-
# --- Operating state ---
|
|
56
|
-
|
|
57
|
-
def getRoomOperatingStateLevel(self, room_id: str) -> str:
|
|
58
|
-
return str(self.getProperty(f"rooms.{room_id}.operating.state")["properties"]["level"]["value"])
|
|
59
|
-
|
|
60
|
-
def getRoomOperatingStateDemand(self, room_id: str) -> str:
|
|
61
|
-
return str(self.getProperty(f"rooms.{room_id}.operating.state")["properties"]["demand"]["value"])
|
|
62
|
-
|
|
63
|
-
def getRoomOperatingStateReason(self, room_id: str) -> str:
|
|
64
|
-
return str(self.getProperty(f"rooms.{room_id}.operating.state")["properties"]["reason"]["value"])
|
|
65
|
-
|
|
66
|
-
# --- Heating programs ---
|
|
67
|
-
|
|
68
|
-
def getRoomNormalHeatingTemperature(self, room_id: str) -> float:
|
|
69
|
-
return float(self.getProperty(f"rooms.{room_id}.operating.programs.normalHeating")["properties"]["temperature"]["value"])
|
|
70
|
-
|
|
71
|
-
@handleAPICommandErrors
|
|
72
|
-
def setRoomNormalHeatingTemperature(self, room_id: str, temperature: float) -> None:
|
|
73
|
-
self.setProperty(f"rooms.{room_id}.operating.programs.normalHeating", "setTemperature",
|
|
74
|
-
{"targetTemperature": temperature})
|
|
75
|
-
|
|
76
|
-
def getRoomReducedHeatingTemperature(self, room_id: str) -> float:
|
|
77
|
-
return float(self.getProperty(f"rooms.{room_id}.operating.programs.reducedHeating")["properties"]["temperature"]["value"])
|
|
78
|
-
|
|
79
|
-
@handleAPICommandErrors
|
|
80
|
-
def setRoomReducedHeatingTemperature(self, room_id: str, temperature: float) -> None:
|
|
81
|
-
self.setProperty(f"rooms.{room_id}.operating.programs.reducedHeating", "setTemperature",
|
|
82
|
-
{"targetTemperature": temperature})
|
|
83
|
-
|
|
84
|
-
def getRoomComfortHeatingTemperature(self, room_id: str) -> float:
|
|
85
|
-
return float(self.getProperty(f"rooms.{room_id}.operating.programs.comfortHeating")["properties"]["temperature"]["value"])
|
|
86
|
-
|
|
87
|
-
@handleAPICommandErrors
|
|
88
|
-
def setRoomComfortHeatingTemperature(self, room_id: str, temperature: float) -> None:
|
|
89
|
-
self.setProperty(f"rooms.{room_id}.operating.programs.comfortHeating", "setTemperature",
|
|
90
|
-
{"targetTemperature": temperature})
|
|
91
|
-
|
|
92
|
-
# --- Schedule ---
|
|
93
|
-
|
|
94
|
-
def getRoomSchedule(self, room_id: str) -> dict[str, Any]:
|
|
95
|
-
props = self.getProperty(f"rooms.{room_id}.schedule")["properties"]
|
|
96
|
-
return {
|
|
97
|
-
"active": props["active"]["value"],
|
|
98
|
-
"mon": props["entries"]["value"]["mon"],
|
|
99
|
-
"tue": props["entries"]["value"]["tue"],
|
|
100
|
-
"wed": props["entries"]["value"]["wed"],
|
|
101
|
-
"thu": props["entries"]["value"]["thu"],
|
|
102
|
-
"fri": props["entries"]["value"]["fri"],
|
|
103
|
-
"sat": props["entries"]["value"]["sat"],
|
|
104
|
-
"sun": props["entries"]["value"]["sun"],
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
# --- Quick modes ---
|
|
108
|
-
|
|
109
|
-
def getRoomManualTillNextScheduleActive(self, room_id: str) -> bool:
|
|
110
|
-
return bool(self.getProperty(
|
|
111
|
-
f"rooms.{room_id}.quickmodes.manualTillNextSchedule")["properties"]["active"]["value"])
|
|
112
|
-
|
|
113
|
-
@handleAPICommandErrors
|
|
114
|
-
def activateRoomManualTillNextSchedule(self, room_id: str, temperature: float) -> None:
|
|
115
|
-
self.setProperty(f"rooms.{room_id}.quickmodes.manualTillNextSchedule", "activate",
|
|
116
|
-
{"temperature": temperature})
|
|
117
|
-
|
|
118
|
-
@handleAPICommandErrors
|
|
119
|
-
def deactivateRoomManualTillNextSchedule(self, room_id: str) -> None:
|
|
120
|
-
self.setProperty(f"rooms.{room_id}.quickmodes.manualTillNextSchedule", "deactivate", {})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|