PyViCare 2.62.1__tar.gz → 2.64.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 (37) hide show
  1. pyvicare-2.64.0/.gitignore +123 -0
  2. {pyvicare-2.62.1 → pyvicare-2.64.0}/PKG-INFO +16 -19
  3. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCare.py +5 -3
  4. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareAbstractOAuthManager.py +8 -6
  5. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareBrowserOAuthManager.py +5 -4
  6. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareCachedService.py +2 -2
  7. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareCachedServiceBase.py +14 -13
  8. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareCachedServiceViaGateway.py +3 -1
  9. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareDevice.py +5 -1
  10. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareDeviceConfig.py +15 -11
  11. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareFloorHeating.py +1 -1
  12. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareFuelCell.py +8 -6
  13. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareGazBoiler.py +8 -6
  14. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareHeatPump.py +37 -8
  15. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareHeatingDevice.py +85 -16
  16. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareOAuthManager.py +8 -7
  17. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareOilBoiler.py +8 -6
  18. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCarePelletsBoiler.py +7 -4
  19. pyvicare-2.64.0/PyViCare/PyViCareRoomControl.py +142 -0
  20. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareService.py +4 -4
  21. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareServiceViaGateway.py +1 -2
  22. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareUtils.py +1 -1
  23. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareVentilationDevice.py +6 -1
  24. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareWaterTreatment.py +7 -8
  25. {pyvicare-2.62.1 → pyvicare-2.64.0}/pyproject.toml +60 -47
  26. pyvicare-2.62.1/PyViCare/PyViCareRoomControl.py +0 -120
  27. {pyvicare-2.62.1 → pyvicare-2.64.0}/LICENSE +0 -0
  28. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/Feature.py +0 -0
  29. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareElectricalEnergySystem.py +0 -0
  30. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareGateway.py +0 -0
  31. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareHeatCurveCalculation.py +0 -0
  32. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareHybrid.py +0 -0
  33. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareRadiatorActuator.py +0 -0
  34. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareRepeater.py +0 -0
  35. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/PyViCareRoomSensor.py +0 -0
  36. {pyvicare-2.62.1 → pyvicare-2.64.0}/PyViCare/__init__.py +0 -0
  37. {pyvicare-2.62.1 → pyvicare-2.64.0}/README.md +0 -0
@@ -0,0 +1,123 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+ MANIFEST
27
+
28
+ # PyInstaller
29
+ # Usually these files are written by a python script from a template
30
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .nox/
42
+ .coverage
43
+ .coverage.*
44
+ .cache
45
+ nosetests.xml
46
+ coverage.xml
47
+ *.cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+
51
+ # Translations
52
+ *.mo
53
+ *.pot
54
+
55
+ # Django stuff:
56
+ *.log
57
+ local_settings.py
58
+ db.sqlite3
59
+
60
+ # Flask stuff:
61
+ instance/
62
+ .webassets-cache
63
+
64
+ # Scrapy stuff:
65
+ .scrapy
66
+
67
+ # Sphinx documentation
68
+ docs/_build/
69
+
70
+ # PyBuilder
71
+ target/
72
+
73
+ # Jupyter Notebook
74
+ .ipynb_checkpoints
75
+
76
+ # IPython
77
+ profile_default/
78
+ ipython_config.py
79
+
80
+ # celery beat schedule file
81
+ celerybeat-schedule
82
+
83
+ # SageMath parsed files
84
+ *.sage.py
85
+
86
+ # Environments
87
+ .env
88
+ .venv
89
+ env/
90
+ venv/
91
+ ENV/
92
+ env.bak/
93
+ venv.bak/
94
+
95
+ # Spyder project settings
96
+ .spyderproject
97
+ .spyproject
98
+
99
+ # Rope project settings
100
+ .ropeproject
101
+
102
+ # mkdocs documentation
103
+ /site
104
+
105
+ # mypy
106
+ .mypy_cache/
107
+ .dmypy.json
108
+ dmypy.json
109
+
110
+ # Pyre type checker
111
+ .pyre/
112
+ token.bin
113
+
114
+ .DS_Store
115
+ .vscode/settings.json
116
+
117
+ *.save
118
+ *.local.sh
119
+ env*
120
+ dump.*json
121
+
122
+ # PyCharm
123
+ .idea
@@ -1,34 +1,32 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: PyViCare
3
- Version: 2.62.1
3
+ Version: 2.64.0
4
4
  Summary: Library to communicate with the Viessmann ViCare API.
5
- License: Apache-2.0
5
+ Project-URL: Homepage, https://github.com/openviess/PyViCare
6
+ Project-URL: Repository, https://github.com/openviess/PyViCare
7
+ Project-URL: Documentation, https://github.com/openviess/PyViCare
8
+ Project-URL: Bug Tracker, https://github.com/openviess/PyViCare/issues
9
+ Project-URL: Changelog, https://github.com/openviess/PyViCare/releases
10
+ Author-email: Simon Gillet <mail+pyvicare@gillet.ninja>
11
+ Maintainer: Martin, Lukas Wöhrl
12
+ Maintainer-email: Christopher Fenner <fenner.christopher@gmail.com>
13
+ License-Expression: Apache-2.0
6
14
  License-File: LICENSE
7
- Keywords: viessmann,vicare,api
8
- Author: Simon Gillet
9
- Author-email: mail+pyvicare@gillet.ninja
10
- Maintainer: Christopher Fenner
11
- Maintainer-email: fenner.christopher@gmail.com
12
- Requires-Python: >=3.10,<4.0
15
+ Keywords: api,vicare,viessmann
13
16
  Classifier: Intended Audience :: Developers
14
17
  Classifier: License :: OSI Approved :: Apache Software License
15
18
  Classifier: Natural Language :: English
16
19
  Classifier: Operating System :: OS Independent
17
20
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.10
19
21
  Classifier: Programming Language :: Python :: 3.11
20
22
  Classifier: Programming Language :: Python :: 3.12
21
23
  Classifier: Programming Language :: Python :: 3.13
22
24
  Classifier: Programming Language :: Python :: 3.14
23
25
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
- Requires-Dist: authlib (>1.2.0)
25
- Requires-Dist: deprecated (>=1.3.0,<2.0.0)
26
- Requires-Dist: requests (>=2.31.0)
27
- Project-URL: Bug Tracker, https://github.com/openviess/PyViCare/issues
28
- Project-URL: Changelog, https://github.com/openviess/PyViCare/releases
29
- Project-URL: Documentation, https://github.com/openviess/PyViCare
30
- Project-URL: Homepage, https://github.com/openviess/PyViCare
31
- Project-URL: Repository, https://github.com/openviess/PyViCare
26
+ Requires-Python: >=3.11
27
+ Requires-Dist: authlib>1.2.0
28
+ Requires-Dist: deprecated<2,>=1.3.0
29
+ Requires-Dist: requests>=2.31.0
32
30
  Description-Content-Type: text/markdown
33
31
 
34
32
  # PyViCare
@@ -227,4 +225,3 @@ To install `ViCare` as a custom component, one can use the terminal addon to ins
227
225
  ```sh
228
226
  curl -o- -L https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d vicare -p <pr-number>
229
227
  ```
230
-
@@ -1,5 +1,6 @@
1
1
  import logging
2
2
  from datetime import datetime
3
+ from typing import ClassVar
3
4
 
4
5
  from PyViCare.PyViCareAbstractOAuthManager import AbstractViCareOAuthManager
5
6
  from PyViCare.PyViCareBrowserOAuthManager import ViCareBrowserOAuthManager
@@ -70,9 +71,10 @@ class PyViCare:
70
71
  self.devices = [d for d in self.all_devices
71
72
  if d.device_type in self.SUPPORTED_DEVICE_TYPES]
72
73
 
73
- SUPPORTED_DEVICE_TYPES = [
74
+ SUPPORTED_DEVICE_TYPES: ClassVar[list[str]] = [
74
75
  "heating", "zigbee", "vitoconnect", "electricityStorage",
75
- "tcu", "ventilation", "roomControl",
76
+ "tcu", "ventilation", "roomControl", "systemController",
77
+ "outdoorUnit",
76
78
  ]
77
79
 
78
80
  def __extract_all_devices(self):
@@ -89,7 +91,7 @@ class PyViCare:
89
91
  yield PyViCareDeviceConfig(accessor, service, device.modelId, device.status, device.deviceType, device.roles)
90
92
 
91
93
 
92
- class DictWrap(object):
94
+ class DictWrap:
93
95
  def __init__(self, d):
94
96
  for k, v in d.items():
95
97
  setattr(self, k, Wrap(v))
@@ -2,15 +2,17 @@ import logging
2
2
  from abc import abstractmethod
3
3
  from typing import Any
4
4
 
5
- from authlib.integrations.base_client import TokenExpiredError, InvalidTokenError
5
+ from authlib.integrations.base_client import InvalidTokenError, TokenExpiredError
6
6
  from authlib.integrations.requests_client import OAuth2Session
7
7
 
8
8
  from PyViCare import Feature
9
- from PyViCare.PyViCareUtils import (PyViCareCommandError,
10
- PyViCareDeviceCommunicationError,
11
- PyViCareInternalServerError,
12
- PyViCareNotPaidForError,
13
- PyViCareRateLimitError)
9
+ from PyViCare.PyViCareUtils import (
10
+ PyViCareCommandError,
11
+ PyViCareDeviceCommunicationError,
12
+ PyViCareInternalServerError,
13
+ PyViCareNotPaidForError,
14
+ PyViCareRateLimitError,
15
+ )
14
16
 
15
17
  logger = logging.getLogger(__name__)
16
18
  logger.addHandler(logging.NullHandler())
@@ -15,8 +15,10 @@ from PyViCare.PyViCareAbstractOAuthManager import (
15
15
  TOKEN_URL,
16
16
  AbstractViCareOAuthManager,
17
17
  )
18
- from PyViCare.PyViCareUtils import (PyViCareBrowserOAuthTimeoutReachedError,
19
- PyViCareInvalidCredentialsError)
18
+ from PyViCare.PyViCareUtils import (
19
+ PyViCareBrowserOAuthTimeoutReachedError,
20
+ PyViCareInvalidCredentialsError,
21
+ )
20
22
 
21
23
  logger = logging.getLogger(__name__)
22
24
  logger.addHandler(logging.NullHandler())
@@ -109,5 +111,4 @@ class ViCareBrowserOAuthManager(AbstractViCareOAuthManager):
109
111
  return OAuth2Session(self.client_id, token=token)
110
112
 
111
113
  def renewToken(self) -> None: # type: ignore
112
- refresh_token = self.oauth_session.refresh_token
113
- self.oauth_session.refresh_token(TOKEN_URL, refresh_token=refresh_token)
114
+ self.oauth_session.refresh_token(TOKEN_URL)
@@ -1,5 +1,5 @@
1
1
  import logging
2
- from typing import Any, List
2
+ from typing import Any
3
3
 
4
4
  from PyViCare.PyViCareAbstractOAuthManager import AbstractViCareOAuthManager
5
5
  from PyViCare.PyViCareCachedServiceBase import ViCareCachedServiceBase
@@ -11,7 +11,7 @@ logger.addHandler(logging.NullHandler())
11
11
 
12
12
  class ViCareCachedService(ViCareCachedServiceBase, ViCareService):
13
13
 
14
- def __init__(self, oauth_manager: AbstractViCareOAuthManager, roles: List[str], cacheDuration: int) -> None:
14
+ def __init__(self, oauth_manager: AbstractViCareOAuthManager, roles: list[str], cacheDuration: int) -> None:
15
15
  ViCareService.__init__(self, oauth_manager, roles)
16
16
  self._init_cache(cacheDuration)
17
17
 
@@ -1,16 +1,17 @@
1
1
  import logging
2
2
  import threading
3
3
  from datetime import datetime
4
- from typing import Any, Optional
5
-
6
- from PyViCare.PyViCareService import (ViCareDeviceAccessor, ViCareService,
7
- readFeature)
8
- from PyViCare.PyViCareUtils import (PyViCareDeviceCommunicationError,
9
- PyViCareInternalServerError,
10
- PyViCareInvalidDataError,
11
- PyViCareNotPaidForError,
12
- PyViCareNotSupportedFeatureError,
13
- ViCareTimer)
4
+ from typing import Any
5
+
6
+ from PyViCare.PyViCareService import ViCareDeviceAccessor, ViCareService, readFeature
7
+ from PyViCare.PyViCareUtils import (
8
+ PyViCareDeviceCommunicationError,
9
+ PyViCareInternalServerError,
10
+ PyViCareInvalidDataError,
11
+ PyViCareNotPaidForError,
12
+ PyViCareNotSupportedFeatureError,
13
+ ViCareTimer,
14
+ )
14
15
 
15
16
  logger = logging.getLogger(__name__)
16
17
  logger.addHandler(logging.NullHandler())
@@ -25,9 +26,9 @@ class ViCareCachedServiceBase(ViCareService):
25
26
 
26
27
  def _init_cache(self, cacheDuration: int) -> None:
27
28
  self._cacheDuration = cacheDuration
28
- self._cache: Optional[dict] = None
29
- self._cacheTime: Optional[datetime] = None
30
- self._cacheError: Optional[Exception] = None
29
+ self._cache: dict | None = None
30
+ self._cacheTime: datetime | None = None
31
+ self._cacheError: Exception | None = None
31
32
  self._cacheLock = threading.Lock()
32
33
 
33
34
  def getProperty(self, accessor: ViCareDeviceAccessor, property_name: str) -> Any:
@@ -5,7 +5,9 @@ from PyViCare.PyViCareAbstractOAuthManager import AbstractViCareOAuthManager
5
5
  from PyViCare.PyViCareCachedServiceBase import ViCareCachedServiceBase
6
6
  from PyViCare.PyViCareService import ViCareDeviceAccessor
7
7
  from PyViCare.PyViCareServiceViaGateway import (
8
- ViCareServiceViaGateway, filter_features_for_device)
8
+ ViCareServiceViaGateway,
9
+ filter_features_for_device,
10
+ )
9
11
 
10
12
  logger = logging.getLogger(__name__)
11
13
  logger.addHandler(logging.NullHandler())
@@ -1,7 +1,11 @@
1
1
  from typing import Any
2
2
 
3
3
  from PyViCare.PyViCareService import ViCareDeviceAccessor, ViCareService, hasRoles
4
- from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError, handleAPICommandErrors, handleNotSupported
4
+ from PyViCare.PyViCareUtils import (
5
+ PyViCareNotSupportedFeatureError,
6
+ handleAPICommandErrors,
7
+ handleNotSupported,
8
+ )
5
9
 
6
10
 
7
11
  class Device:
@@ -2,9 +2,10 @@ import json
2
2
  import logging
3
3
  import re
4
4
 
5
+ from PyViCare.PyViCareElectricalEnergySystem import ElectricalEnergySystem
5
6
  from PyViCare.PyViCareFloorHeating import FloorHeating, FloorHeatingChannel
6
7
  from PyViCare.PyViCareFuelCell import FuelCell
7
- from PyViCare.PyViCareRoomControl import RoomControl
8
+ from PyViCare.PyViCareGateway import Gateway
8
9
  from PyViCare.PyViCareGazBoiler import GazBoiler
9
10
  from PyViCare.PyViCareHeatingDevice import HeatingDevice
10
11
  from PyViCare.PyViCareHeatPump import HeatPump
@@ -12,12 +13,15 @@ from PyViCare.PyViCareHybrid import Hybrid
12
13
  from PyViCare.PyViCareOilBoiler import OilBoiler
13
14
  from PyViCare.PyViCarePelletsBoiler import PelletsBoiler
14
15
  from PyViCare.PyViCareRadiatorActuator import RadiatorActuator
15
- from PyViCare.PyViCareRoomSensor import RoomSensor
16
16
  from PyViCare.PyViCareRepeater import Repeater
17
- from PyViCare.PyViCareElectricalEnergySystem import ElectricalEnergySystem
18
- from PyViCare.PyViCareGateway import Gateway
19
- from PyViCare.PyViCareService import (ViCareDeviceAccessor, ViCareService,
20
- hasRoles, is_gateway_role)
17
+ from PyViCare.PyViCareRoomControl import RoomControl
18
+ from PyViCare.PyViCareRoomSensor import RoomSensor
19
+ from PyViCare.PyViCareService import (
20
+ ViCareDeviceAccessor,
21
+ ViCareService,
22
+ hasRoles,
23
+ is_gateway_role,
24
+ )
21
25
  from PyViCare.PyViCareUtils import PyViCareNotPaidForError
22
26
  from PyViCare.PyViCareVentilationDevice import VentilationDevice
23
27
  from PyViCare.PyViCareWaterTreatment import WaterTreatment
@@ -119,7 +123,7 @@ class PyViCareDeviceConfig:
119
123
  (self.asPelletsBoiler, r"Vitoligno|Ecotronic|VBC550P", []),
120
124
  (self.asOilBoiler, r"Vitoladens|Vitoradial|Vitorondens|VPlusH|V200KW2_6", []),
121
125
  (self.asGazBoiler, r"Vitodens|VScotH|Vitocrossal|VDensH|Vitopend|VPendH|OT_Heating_System", ["type:boiler"]),
122
- (self.asHeatPump, r"Vitocal|VBC70|V200WO1A|CU401B", ["type:heatpump"]),
126
+ (self.asHeatPump, r"Vitocal|VBC70|V200WO1A|CU401B|OBNG_SCU|OBNG_OCU", ["type:heatpump"]),
123
127
  (self.asElectricalEnergySystem, r"E3_VitoCharge_03", ["type:ees"]), # ees, it this a typo?
124
128
  (self.asElectricalEnergySystem, r"E3_VitoCharge_05", ["type:ess"]),
125
129
  (self.asVentilation, r"E3_ViAir", ["type:ventilation"]),
@@ -143,10 +147,10 @@ class PyViCareDeviceConfig:
143
147
  if re.search(type_name, self.device_model) or self.hasRoles(roles):
144
148
  logger.info("detected %s %s", self.device_model, creator_method.__name__)
145
149
  device = creator_method()
146
- if isinstance(device, (GazBoiler, HeatPump)) and not isinstance(device, Hybrid):
147
- if self._isHybridByFeatures():
148
- logger.info("upgrading %s to Hybrid based on API features", self.device_model)
149
- return self.asHybridDevice()
150
+ if (isinstance(device, (GazBoiler, HeatPump)) and not isinstance(device, Hybrid)
151
+ and self._isHybridByFeatures()):
152
+ logger.info("upgrading %s to Hybrid based on API features", self.device_model)
153
+ return self.asHybridDevice()
150
154
  return device
151
155
 
152
156
  logger.info("Could not auto detect %s. Use generic device.", self.device_model)
@@ -1,4 +1,4 @@
1
- from PyViCare.PyViCareDevice import ZigbeeDevice, Device
1
+ from PyViCare.PyViCareDevice import Device, ZigbeeDevice
2
2
  from PyViCare.PyViCareUtils import handleAPICommandErrors, handleNotSupported
3
3
 
4
4
 
@@ -1,16 +1,18 @@
1
- from typing import Any, List
1
+ from typing import Any
2
2
 
3
- from PyViCare.PyViCareHeatingDevice import (HeatingDevice,
4
- HeatingDeviceWithComponent,
5
- get_available_burners)
3
+ from PyViCare.PyViCareHeatingDevice import (
4
+ HeatingDevice,
5
+ HeatingDeviceWithComponent,
6
+ get_available_burners,
7
+ )
6
8
  from PyViCare.PyViCareUtils import handleNotSupported
7
9
 
8
10
 
9
11
  class FuelCell(HeatingDevice):
10
12
 
11
13
  @property
12
- def burners(self) -> List[Any]:
13
- return list([self.getBurner(x) for x in self.getAvailableBurners()])
14
+ def burners(self) -> list[Any]:
15
+ return [self.getBurner(x) for x in self.getAvailableBurners()]
14
16
 
15
17
  def getBurner(self, burner):
16
18
  return FuelCellBurner(self, burner)
@@ -1,16 +1,18 @@
1
- from typing import Any, List
1
+ from typing import Any
2
2
 
3
- from PyViCare.PyViCareHeatingDevice import (HeatingDevice,
4
- HeatingDeviceWithComponent,
5
- get_available_burners)
3
+ from PyViCare.PyViCareHeatingDevice import (
4
+ HeatingDevice,
5
+ HeatingDeviceWithComponent,
6
+ get_available_burners,
7
+ )
6
8
  from PyViCare.PyViCareUtils import handleNotSupported
7
9
 
8
10
 
9
11
  class GazBoiler(HeatingDevice):
10
12
 
11
13
  @property
12
- def burners(self) -> List[Any]:
13
- return list([self.getBurner(x) for x in self.getAvailableBurners()])
14
+ def burners(self) -> list[Any]:
15
+ return [self.getBurner(x) for x in self.getAvailableBurners()]
14
16
 
15
17
  def getBurner(self, burner):
16
18
  return GazBurner(self, burner)
@@ -1,18 +1,23 @@
1
1
  from __future__ import annotations
2
+
2
3
  from contextlib import suppress
3
- from typing import Any, List
4
+ from typing import Any
5
+
4
6
  from deprecated import deprecated
5
7
 
6
8
  from PyViCare.PyViCareHeatingDevice import HeatingDevice, HeatingDeviceWithComponent
7
- from PyViCare.PyViCareUtils import (PyViCareNotSupportedFeatureError,
8
- handleAPICommandErrors, handleNotSupported)
9
+ from PyViCare.PyViCareUtils import (
10
+ PyViCareNotSupportedFeatureError,
11
+ handleAPICommandErrors,
12
+ handleNotSupported,
13
+ )
9
14
  from PyViCare.PyViCareVentilationDevice import VentilationDevice
10
15
 
11
16
 
12
17
  class HeatPump(HeatingDevice, VentilationDevice):
13
18
 
14
19
  @property
15
- def compressors(self) -> List[Compressor]:
20
+ def compressors(self) -> list[Compressor]:
16
21
  return [self.getCompressor(x) for x in self.getAvailableCompressors()]
17
22
 
18
23
  def getCompressor(self, compressor) -> Compressor:
@@ -23,21 +28,21 @@ class HeatPump(HeatingDevice, VentilationDevice):
23
28
  return self.getProperty("heating.compressors")["properties"]["enabled"]["value"]
24
29
 
25
30
  @property
26
- def condensors(self) -> List[Condensor]:
31
+ def condensors(self) -> list[Condensor]:
27
32
  return [self.getCondensor(x) for x in self.getAvailableCompressors()]
28
33
 
29
34
  def getCondensor(self, condensor) -> Condensor:
30
35
  return Condensor(self, condensor)
31
36
 
32
37
  @property
33
- def evaporators(self) -> List[Evaporator]:
38
+ def evaporators(self) -> list[Evaporator]:
34
39
  return [self.getEvaporator(x) for x in self.getAvailableCompressors()]
35
40
 
36
41
  def getEvaporator(self, evaporator) -> Evaporator:
37
42
  return Evaporator(self, evaporator)
38
43
 
39
44
  @property
40
- def inverters(self) -> List[Inverter]:
45
+ def inverters(self) -> list[Inverter]:
41
46
  return [self.getInverter(x) for x in self.getAvailableCompressors()]
42
47
 
43
48
  def getInverter(self, inverter) -> Inverter:
@@ -532,7 +537,7 @@ class HeatPump(HeatingDevice, VentilationDevice):
532
537
 
533
538
  # Cooling circuits
534
539
  @property
535
- def coolingCircuits(self) -> List[CoolingCircuit]:
540
+ def coolingCircuits(self) -> list[CoolingCircuit]:
536
541
  return [self.getCoolingCircuit(x) for x in self.getAvailableCoolingCircuits()]
537
542
 
538
543
  def getCoolingCircuit(self, circuit) -> CoolingCircuit:
@@ -677,6 +682,30 @@ class Compressor(HeatingDeviceWithComponent):
677
682
  def getPowerConsumptionCoolingThisYear(self) -> float:
678
683
  return float(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.cooling")["properties"]["year"]["value"][0])
679
684
 
685
+ @handleNotSupported
686
+ def getPowerConsumptionHeatingThisWeek(self) -> float:
687
+ return float(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.heating.week")["properties"]["value"]["value"])
688
+
689
+ @handleNotSupported
690
+ def getPowerConsumptionHeatingThisWeekUnit(self) -> str:
691
+ return str(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.heating.week")["properties"]["value"]["unit"])
692
+
693
+ @handleNotSupported
694
+ def getPowerConsumptionDHWThisWeek(self) -> float:
695
+ return float(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.dhw.week")["properties"]["value"]["value"])
696
+
697
+ @handleNotSupported
698
+ def getPowerConsumptionDHWThisWeekUnit(self) -> str:
699
+ return str(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.dhw.week")["properties"]["value"]["unit"])
700
+
701
+ @handleNotSupported
702
+ def getPowerConsumptionCoolingThisWeek(self) -> float:
703
+ return float(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.cooling.week")["properties"]["value"]["value"])
704
+
705
+ @handleNotSupported
706
+ def getPowerConsumptionCoolingThisWeekUnit(self) -> str:
707
+ return str(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.cooling.week")["properties"]["value"]["unit"])
708
+
680
709
  @handleNotSupported
681
710
  def getPowerConsumptionTotalThisYear(self) -> float:
682
711
  return float(self.getProperty(f"heating.compressors.{self.compressor}.power.consumption.total")["properties"]["year"]["value"][0])