plugwise 0.37.2__tar.gz → 0.37.4__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-0.37.2 → plugwise-0.37.4}/PKG-INFO +1 -2
  2. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise/__init__.py +7 -6
  3. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise/legacy/smile.py +11 -5
  4. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise/smile.py +24 -15
  5. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise.egg-info/PKG-INFO +1 -2
  6. {plugwise-0.37.2 → plugwise-0.37.4}/pyproject.toml +1 -2
  7. {plugwise-0.37.2 → plugwise-0.37.4}/tests/test_init.py +12 -29
  8. {plugwise-0.37.2 → plugwise-0.37.4}/LICENSE +0 -0
  9. {plugwise-0.37.2 → plugwise-0.37.4}/README.md +0 -0
  10. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise/common.py +0 -0
  11. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise/constants.py +0 -0
  12. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise/data.py +0 -0
  13. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise/exceptions.py +0 -0
  14. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise/helper.py +0 -0
  15. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise/legacy/data.py +0 -0
  16. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise/legacy/helper.py +0 -0
  17. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise/py.typed +0 -0
  18. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise/util.py +0 -0
  19. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise.egg-info/SOURCES.txt +0 -0
  20. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise.egg-info/dependency_links.txt +0 -0
  21. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise.egg-info/requires.txt +0 -0
  22. {plugwise-0.37.2 → plugwise-0.37.4}/plugwise.egg-info/top_level.txt +0 -0
  23. {plugwise-0.37.2 → plugwise-0.37.4}/setup.cfg +0 -0
  24. {plugwise-0.37.2 → plugwise-0.37.4}/setup.py +0 -0
  25. {plugwise-0.37.2 → plugwise-0.37.4}/tests/test_adam.py +0 -0
  26. {plugwise-0.37.2 → plugwise-0.37.4}/tests/test_anna.py +0 -0
  27. {plugwise-0.37.2 → plugwise-0.37.4}/tests/test_generic.py +0 -0
  28. {plugwise-0.37.2 → plugwise-0.37.4}/tests/test_legacy_anna.py +0 -0
  29. {plugwise-0.37.2 → plugwise-0.37.4}/tests/test_legacy_generic.py +0 -0
  30. {plugwise-0.37.2 → plugwise-0.37.4}/tests/test_legacy_p1.py +0 -0
  31. {plugwise-0.37.2 → plugwise-0.37.4}/tests/test_legacy_stretch.py +0 -0
  32. {plugwise-0.37.2 → plugwise-0.37.4}/tests/test_p1.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugwise
3
- Version: 0.37.2
3
+ Version: 0.37.4
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
@@ -35,7 +35,6 @@ Classifier: Development Status :: 5 - Production/Stable
35
35
  Classifier: Intended Audience :: Developers
36
36
  Classifier: License :: OSI Approved :: MIT License
37
37
  Classifier: Operating System :: OS Independent
38
- Classifier: Programming Language :: Python :: 3.11
39
38
  Classifier: Programming Language :: Python :: 3.12
40
39
  Classifier: Topic :: Home Automation
41
40
  Requires-Python: >=3.11.0
@@ -323,13 +323,14 @@ class Smile(SmileComm):
323
323
  """Set the given Temperature on the relevant Thermostat."""
324
324
  await self._smile_api.set_temperature(loc_id, items)
325
325
 
326
- async def set_number_setpoint(self, key: str, _: str, temperature: float) -> None:
326
+ async def set_number(
327
+ self,
328
+ key: str,
329
+ temperature: float,
330
+ dev_id: str | None = None,
331
+ ) -> None:
327
332
  """Set the max. Boiler or DHW setpoint on the Central Heating boiler."""
328
- await self._smile_api.set_number_setpoint(key, temperature)
329
-
330
- async def set_temperature_offset(self, _: str, dev_id: str, offset: float) -> None:
331
- """Set the Temperature offset for thermostats that support this feature."""
332
- await self._smile_api.set_temperature_offset(dev_id, offset)
333
+ await self._smile_api.set_number(key, temperature, dev_id)
333
334
 
334
335
  async def set_switch_state(
335
336
  self, appl_id: str, members: list[str] | None, model: str, state: str
@@ -154,7 +154,12 @@ class SmileLegacyAPI(SmileComm, SmileLegacyData):
154
154
  async def set_gateway_mode(self, mode: str) -> None:
155
155
  """Set-function placeholder for legacy devices."""
156
156
 
157
- async def set_number_setpoint(self, key: str, temperature: float) -> None:
157
+ async def set_number(
158
+ self,
159
+ key: str,
160
+ temperature: float,
161
+ dev_id: str | None,
162
+ ) -> None:
158
163
  """Set-function placeholder for legacy devices."""
159
164
 
160
165
  async def set_preset(self, _: str, preset: str) -> None:
@@ -249,8 +254,12 @@ class SmileLegacyAPI(SmileComm, SmileLegacyData):
249
254
 
250
255
  await self._request(uri, method="put", data=data)
251
256
 
252
- async def set_temperature(self, setpoint: str, _: dict[str, float]) -> None:
257
+ async def set_temperature(self, _: str, items: dict[str, float]) -> None:
253
258
  """Set the given Temperature on the relevant Thermostat."""
259
+ setpoint: float | None = None
260
+ if "setpoint" in items:
261
+ setpoint = items["setpoint"]
262
+
254
263
  if setpoint is None:
255
264
  raise PlugwiseError(
256
265
  "Plugwise: failed setting temperature: no valid input provided"
@@ -264,6 +273,3 @@ class SmileLegacyAPI(SmileComm, SmileLegacyData):
264
273
  )
265
274
 
266
275
  await self._request(uri, method="put", data=data)
267
-
268
- async def set_temperature_offset(self, dev_id: str, offset: float) -> None:
269
- """Set-function placeholder for legacy devices."""
@@ -182,8 +182,17 @@ class SmileAPI(SmileComm, SmileData):
182
182
 
183
183
  await self._request(uri, method="put", data=data)
184
184
 
185
- async def set_number_setpoint(self, key: str, temperature: float) -> None:
186
- """Set the max. Boiler or DHW setpoint on the Central Heating boiler."""
185
+ async def set_number(
186
+ self,
187
+ key: str,
188
+ temperature: float,
189
+ dev_id: str | None,
190
+ ) -> None:
191
+ """Set the maximum boiler- or DHW-setpoint on the Central Heating boiler or the temperature-offset on a Thermostat."""
192
+ if dev_id is not None:
193
+ await self.set_offset(dev_id, temperature)
194
+ return
195
+
187
196
  temp = str(temperature)
188
197
  thermostat_id: str | None = None
189
198
  locator = f'appliance[@id="{self._heater_id}"]/actuator_functionalities/thermostat_functionality'
@@ -199,6 +208,19 @@ class SmileAPI(SmileComm, SmileData):
199
208
  data = f"<thermostat_functionality><setpoint>{temp}</setpoint></thermostat_functionality>"
200
209
  await self._request(uri, method="put", data=data)
201
210
 
211
+ async def set_offset(self, dev_id: str, offset: float) -> None:
212
+ """Set the Temperature offset for thermostats that support this feature."""
213
+ if dev_id not in self.therms_with_offset_func:
214
+ raise PlugwiseError(
215
+ "Plugwise: this device does not have temperature-offset capability."
216
+ )
217
+
218
+ value = str(offset)
219
+ uri = f"{APPLIANCES};id={dev_id}/offset;type=temperature_offset"
220
+ data = f"<offset_functionality><offset>{value}</offset></offset_functionality>"
221
+
222
+ await self._request(uri, method="put", data=data)
223
+
202
224
  async def set_preset(self, loc_id: str, preset: str) -> None:
203
225
  """Set the given Preset on the relevant Thermostat - from LOCATIONS."""
204
226
  if (presets := self._presets(loc_id)) is None:
@@ -410,16 +432,3 @@ class SmileAPI(SmileComm, SmileData):
410
432
  )
411
433
 
412
434
  await self._request(uri, method="put", data=data)
413
-
414
- async def set_temperature_offset(self, dev_id: str, offset: float) -> None:
415
- """Set the Temperature offset for thermostats that support this feature."""
416
- if dev_id not in self.therms_with_offset_func:
417
- raise PlugwiseError(
418
- "Plugwise: this device does not have temperature-offset capability."
419
- )
420
-
421
- value = str(offset)
422
- uri = f"{APPLIANCES};id={dev_id}/offset;type=temperature_offset"
423
- data = f"<offset_functionality><offset>{value}</offset></offset_functionality>"
424
-
425
- await self._request(uri, method="put", data=data)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugwise
3
- Version: 0.37.2
3
+ Version: 0.37.4
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
@@ -35,7 +35,6 @@ Classifier: Development Status :: 5 - Production/Stable
35
35
  Classifier: Intended Audience :: Developers
36
36
  Classifier: License :: OSI Approved :: MIT License
37
37
  Classifier: Operating System :: OS Independent
38
- Classifier: Programming Language :: Python :: 3.11
39
38
  Classifier: Programming Language :: Python :: 3.12
40
39
  Classifier: Topic :: Home Automation
41
40
  Requires-Python: >=3.11.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "plugwise"
7
- version = "0.37.2"
7
+ version = "0.37.4"
8
8
  license = {file = "LICENSE"}
9
9
  description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3."
10
10
  readme = "README.md"
@@ -14,7 +14,6 @@ classifiers = [
14
14
  "Intended Audience :: Developers",
15
15
  "License :: OSI Approved :: MIT License",
16
16
  "Operating System :: OS Independent",
17
- "Programming Language :: Python :: 3.11",
18
17
  "Programming Language :: Python :: 3.12",
19
18
  "Topic :: Home Automation",
20
19
  ]
@@ -686,30 +686,6 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
686
686
 
687
687
  return tinker_temp_passed
688
688
 
689
- @pytest.mark.asyncio
690
- async def tinker_legacy_thermostat_temp(self, smile, unhappy=False):
691
- """Toggle temperature to test functionality."""
692
- _LOGGER.info("Assert modifying temperature setpoint")
693
- tinker_temp_passed = False
694
- test_temp = 22.9
695
- _LOGGER.info("- Adjusting temperature to %s", test_temp)
696
- try:
697
- await smile.set_temperature(test_temp, None)
698
- _LOGGER.info(" + worked as intended")
699
- tinker_temp_passed = True
700
- except (
701
- pw_exceptions.ErrorSendingCommandError,
702
- pw_exceptions.ResponseError,
703
- ):
704
- if unhappy:
705
- _LOGGER.info(" + failed as expected")
706
- tinker_temp_passed = True
707
- else: # pragma: no cover
708
- _LOGGER.info(" - failed unexpectedly")
709
- tinker_temp_passed = False
710
-
711
- return tinker_temp_passed
712
-
713
689
  @pytest.mark.asyncio
714
690
  async def tinker_thermostat_preset(self, smile, loc_id, unhappy=False):
715
691
  """Toggle preset to test functionality."""
@@ -843,9 +819,17 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
843
819
  return result_1 and result_2 and result_3
844
820
 
845
821
  @pytest.mark.asyncio
846
- async def tinker_legacy_thermostat(self, smile, schedule_on=True, unhappy=False):
822
+ async def tinker_legacy_thermostat(
823
+ self,
824
+ smile,
825
+ schedule_on=True,
826
+ block_cooling=False,
827
+ unhappy=False
828
+ ):
847
829
  """Toggle various climate settings to test functionality."""
848
- result_1 = await self.tinker_legacy_thermostat_temp(smile, unhappy)
830
+ result_1 = await self.tinker_thermostat_temp(
831
+ smile, "dummy", block_cooling, unhappy
832
+ )
849
833
  result_2 = await self.tinker_thermostat_preset(smile, None, unhappy)
850
834
  result_3 = await self.tinker_legacy_thermostat_schedule(smile, unhappy)
851
835
  if schedule_on:
@@ -889,11 +873,10 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
889
873
  async def tinker_max_boiler_temp(smile):
890
874
  """Change max boiler temp setpoint to test functionality."""
891
875
  new_temp = 60.0
892
- dev_id = None
893
876
  _LOGGER.info("- Adjusting temperature to %s", new_temp)
894
877
  for test in ["maximum_boiler_temperature", "bogus_temperature"]:
895
878
  try:
896
- await smile.set_number_setpoint(test, dev_id, new_temp)
879
+ await smile.set_number(test, new_temp)
897
880
  _LOGGER.info(" + tinker_max_boiler_temp worked as intended")
898
881
  except pw_exceptions.PlugwiseError:
899
882
  _LOGGER.info(" + tinker_max_boiler_temp failed as intended")
@@ -904,7 +887,7 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
904
887
  new_offset = 1.0
905
888
  _LOGGER.info("- Adjusting temperature offset to %s", new_offset)
906
889
  try:
907
- await smile.set_temperature_offset("dummy", dev_id, new_offset)
890
+ await smile.set_number("dummy", new_offset, dev_id=dev_id)
908
891
  _LOGGER.info(" + tinker_temp_offset worked as intended")
909
892
  return True
910
893
  except pw_exceptions.PlugwiseError:
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