python-bsblan 0.5.15__tar.gz → 0.5.17__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-bsblan
3
- Version: 0.5.15
3
+ Version: 0.5.17
4
4
  Summary: Asynchronous Python client for BSBLAN
5
5
  Home-page: https://github.com/liudger/python-bsblan
6
6
  License: MIT
@@ -18,13 +18,13 @@ Classifier: Natural Language :: English
18
18
  Classifier: Programming Language :: Python :: 3
19
19
  Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
21
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
23
  Requires-Dist: aiohttp (>=3.8.1)
24
+ Requires-Dist: async-timeout (>=4.0.3,<5.0.0)
23
25
  Requires-Dist: backoff (>=2.2.1,<3.0.0)
24
- Requires-Dist: covdefaults (>=2.3.0,<3.0.0)
25
26
  Requires-Dist: packaging (>=21.3)
26
27
  Requires-Dist: pydantic (>=1.9.0)
27
- Requires-Dist: ruff (>=0.0.285,<0.0.286)
28
28
  Requires-Dist: yarl (>=1.7.2)
29
29
  Project-URL: Bug Tracker, https://github.com/liudger/python-bsblan/issues
30
30
  Project-URL: Changelog, https://github.com/liudger/python-bsblan/releases
@@ -177,7 +177,7 @@ check [the contributor's page][contributors].
177
177
 
178
178
  MIT License
179
179
 
180
- Copyright (c) 2023 WJ van Rootselaar
180
+ Copyright (c) 2024 WJ van Rootselaar
181
181
 
182
182
  Permission is hereby granted, free of charge, to any person obtaining a copy
183
183
  of this software and associated documentation files (the "Software"), to deal
@@ -198,7 +198,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
198
198
  SOFTWARE.
199
199
 
200
200
  [bsblanmodule]: https://github.com/fredlcore/bsb_lan
201
- [build-shield]: https://github.com/liudger/python-bsblan/workflows/Continuous%20Integration/badge.svg
201
+ [build-shield]: https://github.com/liudger/python-bsblan/actions/workflows/tests.yaml/badge.svg
202
202
  [build]: https://github.com/liudger/python-bsblan/actions
203
203
  [buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
204
204
  [buymeacoffee]: https://www.buymeacoffee.com/liudger
@@ -209,7 +209,7 @@ SOFTWARE.
209
209
  [keepchangelog]: http://keepachangelog.com/en/1.0.0/
210
210
  [license-shield]: https://img.shields.io/github/license/liudger/python-bsblan.svg
211
211
  [liudger]: https://github.com/liudger
212
- [maintenance-shield]: https://img.shields.io/maintenance/yes/2023.svg
212
+ [maintenance-shield]: https://img.shields.io/maintenance/yes/2024.svg
213
213
  [poetry]: https://python-poetry.org
214
214
  [poetry-install]: https://python-poetry.org/docs/#installation
215
215
  [pre-commit]: https://pre-commit.com/
@@ -143,7 +143,7 @@ check [the contributor's page][contributors].
143
143
 
144
144
  MIT License
145
145
 
146
- Copyright (c) 2023 WJ van Rootselaar
146
+ Copyright (c) 2024 WJ van Rootselaar
147
147
 
148
148
  Permission is hereby granted, free of charge, to any person obtaining a copy
149
149
  of this software and associated documentation files (the "Software"), to deal
@@ -164,7 +164,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
164
164
  SOFTWARE.
165
165
 
166
166
  [bsblanmodule]: https://github.com/fredlcore/bsb_lan
167
- [build-shield]: https://github.com/liudger/python-bsblan/workflows/Continuous%20Integration/badge.svg
167
+ [build-shield]: https://github.com/liudger/python-bsblan/actions/workflows/tests.yaml/badge.svg
168
168
  [build]: https://github.com/liudger/python-bsblan/actions
169
169
  [buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
170
170
  [buymeacoffee]: https://www.buymeacoffee.com/liudger
@@ -175,7 +175,7 @@ SOFTWARE.
175
175
  [keepchangelog]: http://keepachangelog.com/en/1.0.0/
176
176
  [license-shield]: https://img.shields.io/github/license/liudger/python-bsblan.svg
177
177
  [liudger]: https://github.com/liudger
178
- [maintenance-shield]: https://img.shields.io/maintenance/yes/2023.svg
178
+ [maintenance-shield]: https://img.shields.io/maintenance/yes/2024.svg
179
179
  [poetry]: https://python-poetry.org
180
180
  [poetry-install]: https://python-poetry.org/docs/#installation
181
181
  [pre-commit]: https://pre-commit.com/
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-bsblan"
3
- version = "0.5.15"
3
+ version = "0.5.17"
4
4
  description = "Asynchronous Python client for BSBLAN"
5
5
  authors = ["Willem-Jan van Rootselaar <liudgervr@gmail.com>"]
6
6
  maintainers = ["Willem-Jan van Rootselaar <liudgervr@gmail.com>"]
@@ -30,11 +30,12 @@ aiohttp = ">=3.8.1"
30
30
  yarl = ">=1.7.2"
31
31
  pydantic = ">=1.9.0"
32
32
  packaging = ">=21.3"
33
- ruff = "^0.0.285"
34
- covdefaults = "^2.3.0"
35
33
  backoff = "^2.2.1"
34
+ async-timeout = "^4.0.3"
36
35
 
37
36
  [tool.poetry.dev-dependencies]
37
+ covdefaults = "^2.3.0"
38
+ ruff = "^0.1.0"
38
39
  aresponses = "^2.1.6"
39
40
  black = "^23.0.0"
40
41
  blacken-docs = "^1.13.0"
@@ -44,13 +45,13 @@ isort = "^5.11.4"
44
45
  mypy = "^1.0.0"
45
46
  pre-commit = "^3.0.0"
46
47
  pre-commit-hooks = "^4.3.0"
47
- pylint = "^2.15.10"
48
+ pylint = "^3.0.0"
48
49
  pytest = "^7.2.1"
49
- pytest-asyncio = "^0.21.0"
50
+ pytest-asyncio = "^0.23.0"
50
51
  pytest-cov = "^4.0.0"
51
52
  yamllint = "^1.29.0"
52
53
  pyupgrade = "^3.3.1"
53
- flake8-simplify = "^0.20.0"
54
+ flake8-simplify = "^0.21.0"
54
55
  vulture = "^2.7"
55
56
  darglint = "^1.8.1"
56
57
  safety = "^2.3.4"
@@ -15,6 +15,7 @@ from aiohttp.client import ClientError, ClientResponseError, ClientSession
15
15
  from aiohttp.hdrs import METH_POST
16
16
  from aiohttp.helpers import BasicAuth
17
17
  from packaging import version as pkg_version
18
+ from typing_extensions import Self
18
19
  from yarl import URL
19
20
 
20
21
  from .constants import (
@@ -63,6 +64,7 @@ class BSBLAN:
63
64
  _auth: BasicAuth | None = None
64
65
  _close_session: bool = False
65
66
 
67
+ # cSpell:ignore BSBLAN
66
68
  @backoff.on_exception(backoff.expo, BSBLANConnectionError, max_tries=3, logger=None)
67
69
  async def _request(
68
70
  self,
@@ -172,7 +174,7 @@ class BSBLAN:
172
174
 
173
175
  # set hvac_mode with correct value
174
176
  data["hvac_mode"]["value"] = HVAC_MODE_DICT[int(data["hvac_mode"]["value"])]
175
- return State.parse_obj(data)
177
+ return State.model_validate(data)
176
178
 
177
179
  async def sensor(self) -> Sensor:
178
180
  """Get the sensor information from BSBLAN device.
@@ -190,7 +192,7 @@ class BSBLAN:
190
192
  # retrieve sensor params so we can build the data structure
191
193
  data = await self._request(params={"Parameter": f"{self._sensor_list}"})
192
194
  data = dict(zip(self._sensor_params, list(data.values()), strict=True))
193
- return Sensor.parse_obj(data)
195
+ return Sensor.model_validate(data)
194
196
 
195
197
  async def static_values(self) -> StaticState:
196
198
  """Get the static information from BSBLAN device.
@@ -210,7 +212,7 @@ class BSBLAN:
210
212
  data = dict(zip(self._static_params, list(data.values()), strict=True))
211
213
  self._min_temp = data["min_temp"]["value"]
212
214
  self._max_temp = data["max_temp"]["value"]
213
- return StaticState.parse_obj(data)
215
+ return StaticState.model_validate(data)
214
216
 
215
217
  async def _get_dict_version(self) -> dict[Any, Any]:
216
218
  """Get the version from device.
@@ -249,7 +251,7 @@ class BSBLAN:
249
251
 
250
252
  """
251
253
  device_info = await self._request(base_path="/JI")
252
- return Device.parse_obj(device_info)
254
+ return Device.model_validate(device_info)
253
255
 
254
256
  async def info(self) -> Info:
255
257
  """Get information about the current heating system config.
@@ -266,7 +268,7 @@ class BSBLAN:
266
268
 
267
269
  data = await self._request(params={"Parameter": f"{self._info}"})
268
270
  data = dict(zip(self._device_params, list(data.values()), strict=True))
269
- return Info.parse_obj(data)
271
+ return Info.model_validate(data)
270
272
 
271
273
  async def _get_parameters(self, params: dict[Any, Any]) -> dict[Any, Any]:
272
274
  """Get the parameters info from BSBLAN device.
@@ -349,13 +351,14 @@ class BSBLAN:
349
351
  if self.session and self._close_session:
350
352
  await self.session.close()
351
353
 
352
- async def __aenter__(self) -> BSBLAN:
354
+ async def __aenter__(self) -> Self:
353
355
  """Async enter.
354
356
 
355
357
  Returns
356
358
  -------
357
359
  The BSBLAN object.
358
360
  """
361
+ logger.debug("BSBLAN: %s", self)
359
362
  return self
360
363
 
361
364
  async def __aexit__(self, *_exc_info: object) -> None: