plugwise 1.4.4__tar.gz → 1.5.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 (32) hide show
  1. {plugwise-1.4.4 → plugwise-1.5.0}/PKG-INFO +1 -1
  2. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/__init__.py +20 -16
  3. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/helper.py +0 -1
  4. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise.egg-info/PKG-INFO +1 -1
  5. {plugwise-1.4.4 → plugwise-1.5.0}/pyproject.toml +1 -1
  6. {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_init.py +3 -5
  7. {plugwise-1.4.4 → plugwise-1.5.0}/LICENSE +0 -0
  8. {plugwise-1.4.4 → plugwise-1.5.0}/README.md +0 -0
  9. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/common.py +0 -0
  10. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/constants.py +0 -0
  11. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/data.py +0 -0
  12. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/exceptions.py +0 -0
  13. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/legacy/data.py +0 -0
  14. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/legacy/helper.py +0 -0
  15. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/legacy/smile.py +0 -0
  16. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/py.typed +0 -0
  17. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/smile.py +0 -0
  18. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise/util.py +0 -0
  19. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise.egg-info/SOURCES.txt +0 -0
  20. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise.egg-info/dependency_links.txt +0 -0
  21. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise.egg-info/requires.txt +0 -0
  22. {plugwise-1.4.4 → plugwise-1.5.0}/plugwise.egg-info/top_level.txt +0 -0
  23. {plugwise-1.4.4 → plugwise-1.5.0}/setup.cfg +0 -0
  24. {plugwise-1.4.4 → plugwise-1.5.0}/setup.py +0 -0
  25. {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_adam.py +0 -0
  26. {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_anna.py +0 -0
  27. {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_generic.py +0 -0
  28. {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_legacy_anna.py +0 -0
  29. {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_legacy_generic.py +0 -0
  30. {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_legacy_p1.py +0 -0
  31. {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_legacy_stretch.py +0 -0
  32. {plugwise-1.4.4 → plugwise-1.5.0}/tests/test_p1.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugwise
3
- Version: 1.4.4
3
+ Version: 1.5.0
4
4
  Summary: Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3.
5
5
  Home-page: https://github.com/plugwise/python-plugwise
6
6
  Author: Plugwise device owners
@@ -5,7 +5,9 @@ Plugwise backend module for Home Assistant Core.
5
5
  from __future__ import annotations
6
6
 
7
7
  from plugwise.constants import (
8
+ DEFAULT_LEGACY_TIMEOUT,
8
9
  DEFAULT_PORT,
10
+ DEFAULT_TIMEOUT,
9
11
  DEFAULT_USERNAME,
10
12
  DOMAIN_OBJECTS,
11
13
  LOGGER,
@@ -43,26 +45,25 @@ class Smile(SmileComm):
43
45
  self,
44
46
  host: str,
45
47
  password: str,
46
- timeout: int,
47
48
  websession: aiohttp.ClientSession,
48
49
  port: int = DEFAULT_PORT,
49
50
  username: str = DEFAULT_USERNAME,
50
51
  ) -> None:
51
52
  """Set the constructor for this class."""
52
- super().__init__(
53
- host,
54
- password,
55
- port,
56
- timeout,
57
- username,
58
- websession,
59
- )
60
-
61
53
  self._host = host
62
- self._passwd = password
54
+ self._password = password
63
55
  self._port = port
64
- self._user = username
56
+ self._timeout = DEFAULT_LEGACY_TIMEOUT
57
+ self._username = username
65
58
  self._websession = websession
59
+ super().__init__(
60
+ self._host,
61
+ self._password,
62
+ self._port,
63
+ self._timeout,
64
+ self._username,
65
+ self._websession,
66
+ )
66
67
 
67
68
  self._cooling_present = False
68
69
  self._elga = False
@@ -126,7 +127,7 @@ class Smile(SmileComm):
126
127
 
127
128
  self._smile_api = SmileAPI(
128
129
  self._host,
129
- self._passwd,
130
+ self._password,
130
131
  self._request,
131
132
  self._websession,
132
133
  self._cooling_present,
@@ -147,10 +148,10 @@ class Smile(SmileComm):
147
148
  self.smile_name,
148
149
  self.smile_type,
149
150
  self._port,
150
- self._user,
151
+ self._username,
151
152
  ) if not self.smile_legacy else SmileLegacyAPI(
152
153
  self._host,
153
- self._passwd,
154
+ self._password,
154
155
  self._request,
155
156
  self._websession,
156
157
  self._is_thermostat,
@@ -168,7 +169,7 @@ class Smile(SmileComm):
168
169
  self.smile_type,
169
170
  self.smile_zigbee_mac_address,
170
171
  self._port,
171
- self._user,
172
+ self._username,
172
173
  )
173
174
 
174
175
  # Update all endpoints on first connect
@@ -212,6 +213,9 @@ class Smile(SmileComm):
212
213
  )
213
214
  raise UnsupportedDeviceError
214
215
 
216
+ if not self.smile_legacy:
217
+ self._timeout = DEFAULT_TIMEOUT
218
+
215
219
  if self._target_smile in ("smile_open_therm_v2", "smile_thermo_v3"):
216
220
  LOGGER.error(
217
221
  "Your Smile identified as %s needs a firmware update as it's firmware is severely outdated",
@@ -100,7 +100,6 @@ class SmileComm:
100
100
 
101
101
  self._auth = BasicAuth(username, password=password)
102
102
  self._endpoint = f"http://{host}:{str(port)}"
103
- self._timeout = timeout
104
103
 
105
104
  async def _request(
106
105
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugwise
3
- Version: 1.4.4
3
+ Version: 1.5.0
4
4
  Summary: Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3.
5
5
  Home-page: https://github.com/plugwise/python-plugwise
6
6
  Author: Plugwise device owners
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "plugwise"
7
- version = "1.4.4"
7
+ version = "1.5.0"
8
8
  license = {file = "LICENSE"}
9
9
  description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3."
10
10
  readme = "README.md"
@@ -323,7 +323,6 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
323
323
  username=pw_constants.DEFAULT_USERNAME,
324
324
  password=test_password,
325
325
  port=server.port,
326
- timeout=pw_constants.DEFAULT_TIMEOUT,
327
326
  websession=None,
328
327
  )
329
328
  lack_of_websession = False
@@ -337,18 +336,18 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
337
336
  username=pw_constants.DEFAULT_USERNAME,
338
337
  password=test_password,
339
338
  port=server.port,
340
- timeout=pw_constants.DEFAULT_TIMEOUT,
341
339
  websession=websession,
342
340
  )
343
341
 
344
342
  if not timeout:
345
- assert smile._timeout == 10
343
+ assert smile._timeout == 30
346
344
 
347
345
  # Connect to the smile
348
346
  version = None
349
347
  try:
350
348
  version = await smile.connect()
351
349
  assert version is not None
350
+ assert smile._timeout == 10
352
351
  return server, smile, client
353
352
  except (
354
353
  pw_exceptions.ConnectionFailedError,
@@ -408,7 +407,6 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
408
407
  username=pw_constants.DEFAULT_USERNAME,
409
408
  password=test_password,
410
409
  port=server.port,
411
- timeout=pw_constants.DEFAULT_LEGACY_TIMEOUT,
412
410
  websession=None,
413
411
  )
414
412
  lack_of_websession = False
@@ -422,7 +420,6 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
422
420
  username=pw_constants.DEFAULT_USERNAME,
423
421
  password=test_password,
424
422
  port=server.port,
425
- timeout=pw_constants.DEFAULT_LEGACY_TIMEOUT,
426
423
  websession=websession,
427
424
  )
428
425
 
@@ -434,6 +431,7 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
434
431
  try:
435
432
  version = await smile.connect()
436
433
  assert version is not None
434
+ assert smile._timeout == 30
437
435
  return server, smile, client
438
436
  except (
439
437
  pw_exceptions.ConnectionFailedError,
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