PyViCare 2.51.0__tar.gz → 2.53.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.
Files changed (30) hide show
  1. {pyvicare-2.51.0 → pyvicare-2.53.0}/PKG-INFO +23 -2
  2. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareDevice.py +34 -1
  3. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareDeviceConfig.py +14 -0
  4. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareElectricalEnergySystem.py +36 -0
  5. pyvicare-2.53.0/PyViCare/PyViCareFloorHeating.py +32 -0
  6. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareGazBoiler.py +9 -0
  7. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareRadiatorActuator.py +12 -8
  8. pyvicare-2.53.0/PyViCare/PyViCareRepeater.py +6 -0
  9. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareRoomSensor.py +2 -6
  10. {pyvicare-2.51.0 → pyvicare-2.53.0}/README.md +19 -0
  11. {pyvicare-2.51.0 → pyvicare-2.53.0}/pyproject.toml +3 -3
  12. {pyvicare-2.51.0 → pyvicare-2.53.0}/LICENSE +0 -0
  13. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/Feature.py +0 -0
  14. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCare.py +0 -0
  15. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareAbstractOAuthManager.py +0 -0
  16. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareBrowserOAuthManager.py +0 -0
  17. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareCachedService.py +0 -0
  18. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareFuelCell.py +0 -0
  19. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareGateway.py +0 -0
  20. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareHeatCurveCalculation.py +0 -0
  21. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareHeatPump.py +0 -0
  22. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareHeatingDevice.py +0 -0
  23. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareHybrid.py +0 -0
  24. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareOAuthManager.py +0 -0
  25. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareOilBoiler.py +0 -0
  26. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCarePelletsBoiler.py +0 -0
  27. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareService.py +0 -0
  28. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareUtils.py +0 -0
  29. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/PyViCareVentilationDevice.py +0 -0
  30. {pyvicare-2.51.0 → pyvicare-2.53.0}/PyViCare/__init__.py +0 -0
@@ -1,8 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: PyViCare
3
- Version: 2.51.0
3
+ Version: 2.53.0
4
4
  Summary: Library to communicate with the Viessmann ViCare API.
5
5
  License: Apache-2.0
6
+ License-File: LICENSE
6
7
  Keywords: viessmann,vicare,api
7
8
  Author: Simon Gillet
8
9
  Author-email: mail+pyvicare@gillet.ninja
@@ -19,6 +20,7 @@ Classifier: Programming Language :: Python :: 3.10
19
20
  Classifier: Programming Language :: Python :: 3.11
20
21
  Classifier: Programming Language :: Python :: 3.12
21
22
  Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
22
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
25
  Requires-Dist: authlib (>1.2.0)
24
26
  Requires-Dist: deprecated (>=1.2.15,<2.0.0)
@@ -208,3 +210,22 @@ To make the test data comparable with future updates, it must be sorted. No worr
208
210
  jq ".data|=sort_by(.feature)" --sort-keys testData.json > testDataSorted.json
209
211
  ```
210
212
 
213
+ ## Testing
214
+
215
+ ### Home Assistant
216
+
217
+ To test a certain change in Home Assistant, one needs to have a `ViCare` integration installed as a custom component.
218
+ Change the dependency in the `manifest.json` to point to a GitHub branch or commit SHA:
219
+
220
+ ```json
221
+ "requirements": [
222
+ "PyViCare@git+https://github.com/openviess/PyViCare.git@<branchname>"
223
+ ],
224
+ ```
225
+
226
+ To install `ViCare` as a custom component, one can use the terminal addon to install the changes from a certain Home Assistant PR:
227
+
228
+ ```sh
229
+ curl -o- -L https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d vicare -p <pr-number>
230
+ ```
231
+
@@ -1,7 +1,7 @@
1
1
  from typing import Any
2
2
 
3
3
  from PyViCare.PyViCareService import ViCareService
4
- from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError, handleNotSupported
4
+ from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError, handleAPICommandErrors, handleNotSupported
5
5
 
6
6
 
7
7
  class Device:
@@ -42,3 +42,36 @@ class Device:
42
42
  return self.service.getProperty(deviceType)["isEnabled"] and self.service.getProperty(deviceType)["properties"]["active"]["value"]
43
43
  except PyViCareNotSupportedFeatureError:
44
44
  return False
45
+
46
+
47
+ class ZigbeeDevice(Device):
48
+
49
+ @handleNotSupported
50
+ def getSerial(self) -> str:
51
+ return str(self.service.getProperty("device.zigbee.parent.id")["deviceId"])
52
+
53
+ @handleNotSupported
54
+ def getZigbeeParentID(self) -> str:
55
+ return str(self.service.getProperty("device.zigbee.parent.id")["properties"]["value"]["value"])
56
+
57
+ @handleNotSupported
58
+ def getZigbeeSignalStrength(self) -> int:
59
+ return int(self.service.getProperty("device.zigbee.lqi")["properties"]["strength"]["value"])
60
+
61
+ @handleNotSupported
62
+ def getName(self) -> str:
63
+ return str(self.service.getProperty("device.name")["properties"]["name"]["value"])
64
+
65
+ @handleAPICommandErrors
66
+ def setName(self, name: str) -> None:
67
+ self.service.setProperty("device.name", "setName", {'name': name})
68
+
69
+ @handleNotSupported
70
+ def getIdentification(self) -> bool:
71
+ return bool(self.service.getProperty("device.identification")["properties"]["triggered"]["value"])
72
+
73
+ class ZigbeeBatteryDevice(ZigbeeDevice):
74
+
75
+ @handleNotSupported
76
+ def getBatteryLevel(self) -> int:
77
+ return int(self.service.getProperty("device.power.battery")["properties"]["level"]["value"])
@@ -2,6 +2,7 @@ import json
2
2
  import logging
3
3
  import re
4
4
 
5
+ from PyViCare.PyViCareFloorHeating import FloorHeating, FloorHeatingChannel
5
6
  from PyViCare.PyViCareFuelCell import FuelCell
6
7
  from PyViCare.PyViCareGazBoiler import GazBoiler
7
8
  from PyViCare.PyViCareHeatingDevice import HeatingDevice
@@ -11,6 +12,7 @@ from PyViCare.PyViCareOilBoiler import OilBoiler
11
12
  from PyViCare.PyViCarePelletsBoiler import PelletsBoiler
12
13
  from PyViCare.PyViCareRadiatorActuator import RadiatorActuator
13
14
  from PyViCare.PyViCareRoomSensor import RoomSensor
15
+ from PyViCare.PyViCareRepeater import Repeater
14
16
  from PyViCare.PyViCareElectricalEnergySystem import ElectricalEnergySystem
15
17
  from PyViCare.PyViCareGateway import Gateway
16
18
  from PyViCare.PyViCareVentilationDevice import VentilationDevice
@@ -50,9 +52,18 @@ class PyViCareDeviceConfig:
50
52
  def asRadiatorActuator(self):
51
53
  return RadiatorActuator(self.service)
52
54
 
55
+ def asFloorHeating(self):
56
+ return FloorHeating(self.service)
57
+
58
+ def asFloorHeatingChannel(self):
59
+ return FloorHeatingChannel(self.service)
60
+
53
61
  def asRoomSensor(self):
54
62
  return RoomSensor(self.service)
55
63
 
64
+ def asRepeater(self):
65
+ return Repeater(self.service)
66
+
56
67
  def asElectricalEnergySystem(self):
57
68
  return ElectricalEnergySystem(self.service)
58
69
 
@@ -88,7 +99,10 @@ class PyViCareDeviceConfig:
88
99
  (self.asVentilation, r"E3_ViAir", ["type:ventilation;central"]),
89
100
  (self.asVentilation, r"E3_VitoPure", ["type:ventilation;purifier"]),
90
101
  (self.asRadiatorActuator, r"E3_RadiatorActuator", ["type:radiator"]),
102
+ (self.asFloorHeating, r"Smart_zigbee_fht_main|E3_FloorHeatingCircuitDistributorBox", ["type:fhtMain"]),
103
+ (self.asFloorHeatingChannel, r"Smart_zigbee_fht_channel", ["type:fhtChannel"]),
91
104
  (self.asRoomSensor, r"E3_RoomSensor", ["type:climateSensor"]),
105
+ (self.asRepeater, r"E3_Repeater", ["type:repeater"]),
92
106
  (self.asGateway, r"E3_TCU41_x04", ["type:gateway;TCU100"]),
93
107
  (self.asGateway, r"E3_TCU19_x05", ["type:gateway;TCU200"]),
94
108
  (self.asGateway, r"E3_TCU10_x07", ["type:gateway;TCU300"]),
@@ -88,6 +88,42 @@ class ElectricalEnergySystem(Device):
88
88
  "value"
89
89
  ]["unit"]
90
90
 
91
+ @handleNotSupported
92
+ def getElectricalEnergySystemTransferChargeCumulatedUnit(self):
93
+ return self.service.getProperty("ess.transfer.charge.cumulated")[
94
+ "properties"
95
+ ]["currentDay"]["unit"]
96
+
97
+ @handleNotSupported
98
+ def getElectricalEnergySystemTransferChargeCumulatedCurrentDay(self):
99
+ return self.service.getProperty("ess.transfer.charge.cumulated")[
100
+ "properties"
101
+ ]["currentDay"]["value"]
102
+
103
+ @handleNotSupported
104
+ def getElectricalEnergySystemTransferChargeCumulatedCurrentWeek(self):
105
+ return self.service.getProperty("ess.transfer.charge.cumulated")[
106
+ "properties"
107
+ ]["currentWeek"]["value"]
108
+
109
+ @handleNotSupported
110
+ def getElectricalEnergySystemTransferChargeCumulatedCurrentMonth(self):
111
+ return self.service.getProperty("ess.transfer.charge.cumulated")[
112
+ "properties"
113
+ ]["currentMonth"]["value"]
114
+
115
+ @handleNotSupported
116
+ def getElectricalEnergySystemTransferChargeCumulatedCurrentYear(self):
117
+ return self.service.getProperty("ess.transfer.charge.cumulated")[
118
+ "properties"
119
+ ]["currentYear"]["value"]
120
+
121
+ @handleNotSupported
122
+ def getElectricalEnergySystemTransferChargeCumulatedLifeCycle(self):
123
+ return self.service.getProperty("ess.transfer.charge.cumulated")[
124
+ "properties"
125
+ ]["lifeCycle"]["value"]
126
+
91
127
  @handleNotSupported
92
128
  def getElectricalEnergySystemTransferDischargeCumulatedUnit(self):
93
129
  return self.service.getProperty("ess.transfer.discharge.cumulated")[
@@ -0,0 +1,32 @@
1
+ from PyViCare.PyViCareDevice import ZigbeeDevice, Device
2
+ from PyViCare.PyViCareUtils import handleAPICommandErrors, handleNotSupported
3
+
4
+
5
+ class FloorHeating(ZigbeeDevice):
6
+
7
+ @handleNotSupported
8
+ def getSupplyTemperature(self) -> float:
9
+ return float(self.service.getProperty("fht.sensors.temperature.supply")["properties"]["value"]["value"])
10
+
11
+ @handleNotSupported
12
+ def getActiveMode(self) -> str:
13
+ return str(self.service.getProperty("fht.operating.modes.active")["properties"]["value"]["value"])
14
+
15
+
16
+ class FloorHeatingChannel(Device):
17
+
18
+ @handleNotSupported
19
+ def getSerial(self) -> str:
20
+ return str(self.service.getProperty("device.name")["deviceId"])
21
+
22
+ @handleNotSupported
23
+ def getName(self) -> str:
24
+ return str(self.service.getProperty("device.name")["properties"]["name"]["value"])
25
+
26
+ @handleAPICommandErrors
27
+ def setName(self, name: str) -> None:
28
+ self.service.setProperty("device.name", "setName", {'name': name})
29
+
30
+ @handleNotSupported
31
+ def getValvePosition(self) -> str:
32
+ return str(self.service.getProperty("fht.valve.state")["properties"]["status"]["value"])
@@ -260,6 +260,15 @@ class GazBoiler(HeatingDevice):
260
260
  def getPowerSummaryConsumptionDomesticHotWaterLastYear(self):
261
261
  return self.service.getProperty("heating.power.consumption.summary.dhw")["properties"]["lastYear"]["value"]
262
262
 
263
+ @handleNotSupported
264
+ def getSupplyPressureUnit(self) -> str:
265
+ # Returns heating supply pressure unit (e.g. bar)
266
+ return str(self.service.getProperty("heating.sensors.pressure.supply")["properties"]["value"]["unit"])
267
+
268
+ @handleNotSupported
269
+ def getSupplyPressure(self) -> float:
270
+ # Returns heating supply pressure
271
+ return float(self.service.getProperty("heating.sensors.pressure.supply")["properties"]["value"]["value"])
263
272
 
264
273
  class GazBurner(HeatingDeviceWithComponent):
265
274
 
@@ -1,20 +1,24 @@
1
- from PyViCare.PyViCareDevice import Device
1
+ from PyViCare.PyViCareDevice import ZigbeeBatteryDevice
2
2
  from PyViCare.PyViCareUtils import handleAPICommandErrors, handleNotSupported
3
3
 
4
4
 
5
- class RadiatorActuator(Device):
5
+ class RadiatorActuator(ZigbeeBatteryDevice):
6
6
 
7
7
  @handleNotSupported
8
- def getSerial(self):
9
- return self.service.getProperty("device.name")["deviceId"]
8
+ def getTemperature(self):
9
+ return self.service.getProperty("device.sensors.temperature")["properties"]["value"]["value"]
10
10
 
11
11
  @handleNotSupported
12
- def getBatteryLevel(self) -> int:
13
- return int(self.service.getProperty("device.power.battery")["properties"]["level"]["value"])
12
+ def getValvePosition(self) -> int:
13
+ return int(self.service.getProperty("trv.valve.position")["properties"]["position"]["value"])
14
14
 
15
15
  @handleNotSupported
16
- def getTemperature(self):
17
- return self.service.getProperty("device.sensors.temperature")["properties"]["value"]["value"]
16
+ def getChildLock(self) -> str:
17
+ return str(self.service.getProperty("trv.childLock")["properties"]["status"]["value"])
18
+
19
+ @handleNotSupported
20
+ def getMountingMode(self) -> bool:
21
+ return bool(self.service.getProperty("trv.mountingMode")["properties"]["active"]["value"])
18
22
 
19
23
  @handleNotSupported
20
24
  def getTargetTemperature(self):
@@ -0,0 +1,6 @@
1
+ from PyViCare.PyViCareDevice import ZigbeeDevice
2
+
3
+
4
+ class Repeater(ZigbeeDevice):
5
+
6
+ pass
@@ -1,17 +1,13 @@
1
- from PyViCare.PyViCareDevice import Device
1
+ from PyViCare.PyViCareDevice import ZigbeeBatteryDevice
2
2
  from PyViCare.PyViCareUtils import handleNotSupported
3
3
 
4
4
 
5
- class RoomSensor(Device):
5
+ class RoomSensor(ZigbeeBatteryDevice):
6
6
 
7
7
  @handleNotSupported
8
8
  def getSerial(self):
9
9
  return self.service.getProperty("device.sensors.temperature")["deviceId"]
10
10
 
11
- @handleNotSupported
12
- def getBatteryLevel(self) -> int:
13
- return int(self.service.getProperty("device.power.battery")["properties"]["level"]["value"])
14
-
15
11
  @handleNotSupported
16
12
  def getTemperature(self):
17
13
  return self.service.getProperty("device.sensors.temperature")["properties"]["value"]["value"]
@@ -175,3 +175,22 @@ To make the test data comparable with future updates, it must be sorted. No worr
175
175
  ```sh
176
176
  jq ".data|=sort_by(.feature)" --sort-keys testData.json > testDataSorted.json
177
177
  ```
178
+
179
+ ## Testing
180
+
181
+ ### Home Assistant
182
+
183
+ To test a certain change in Home Assistant, one needs to have a `ViCare` integration installed as a custom component.
184
+ Change the dependency in the `manifest.json` to point to a GitHub branch or commit SHA:
185
+
186
+ ```json
187
+ "requirements": [
188
+ "PyViCare@git+https://github.com/openviess/PyViCare.git@<branchname>"
189
+ ],
190
+ ```
191
+
192
+ To install `ViCare` as a custom component, one can use the terminal addon to install the changes from a certain Home Assistant PR:
193
+
194
+ ```sh
195
+ curl -o- -L https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d vicare -p <pr-number>
196
+ ```
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "PyViCare"
3
- version = "2.51.0"
3
+ version = "2.53.0"
4
4
  description = "Library to communicate with the Viessmann ViCare API."
5
5
  authors = [
6
6
  "Simon Gillet <mail+pyvicare@gillet.ninja>"
@@ -51,8 +51,8 @@ codespell = "^2.3.0"
51
51
  mypy = "^1.11.2"
52
52
  pylint = "^3.2.6"
53
53
  pytest = "^8.3.2"
54
- pytest-cov = "^6.0.0"
55
- ruff = "^0.12.0"
54
+ pytest-cov = "^7.0.0"
55
+ ruff = "^0.14.0"
56
56
  types-deprecated = "^1.2.15.20241117"
57
57
  types-requests = ">=2.31"
58
58
 
File without changes
File without changes