plugwise 0.37.4.1__tar.gz → 0.37.5__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.4.1 → plugwise-0.37.5}/PKG-INFO +1 -1
  2. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise/__init__.py +7 -6
  3. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise/legacy/smile.py +6 -4
  4. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise/smile.py +23 -17
  5. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise.egg-info/PKG-INFO +1 -1
  6. {plugwise-0.37.4.1 → plugwise-0.37.5}/pyproject.toml +1 -1
  7. {plugwise-0.37.4.1 → plugwise-0.37.5}/tests/test_init.py +5 -6
  8. {plugwise-0.37.4.1 → plugwise-0.37.5}/LICENSE +0 -0
  9. {plugwise-0.37.4.1 → plugwise-0.37.5}/README.md +0 -0
  10. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise/common.py +0 -0
  11. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise/constants.py +0 -0
  12. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise/data.py +0 -0
  13. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise/exceptions.py +0 -0
  14. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise/helper.py +0 -0
  15. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise/legacy/data.py +0 -0
  16. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise/legacy/helper.py +0 -0
  17. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise/py.typed +0 -0
  18. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise/util.py +0 -0
  19. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise.egg-info/SOURCES.txt +0 -0
  20. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise.egg-info/dependency_links.txt +0 -0
  21. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise.egg-info/requires.txt +0 -0
  22. {plugwise-0.37.4.1 → plugwise-0.37.5}/plugwise.egg-info/top_level.txt +0 -0
  23. {plugwise-0.37.4.1 → plugwise-0.37.5}/setup.cfg +0 -0
  24. {plugwise-0.37.4.1 → plugwise-0.37.5}/setup.py +0 -0
  25. {plugwise-0.37.4.1 → plugwise-0.37.5}/tests/test_adam.py +0 -0
  26. {plugwise-0.37.4.1 → plugwise-0.37.5}/tests/test_anna.py +0 -0
  27. {plugwise-0.37.4.1 → plugwise-0.37.5}/tests/test_generic.py +0 -0
  28. {plugwise-0.37.4.1 → plugwise-0.37.5}/tests/test_legacy_anna.py +0 -0
  29. {plugwise-0.37.4.1 → plugwise-0.37.5}/tests/test_legacy_generic.py +0 -0
  30. {plugwise-0.37.4.1 → plugwise-0.37.5}/tests/test_legacy_p1.py +0 -0
  31. {plugwise-0.37.4.1 → plugwise-0.37.5}/tests/test_legacy_stretch.py +0 -0
  32. {plugwise-0.37.4.1 → plugwise-0.37.5}/tests/test_p1.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugwise
3
- Version: 0.37.4.1
3
+ Version: 0.37.5
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
@@ -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
+ dev_id: str,
329
+ key: str,
330
+ temperature: float,
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(dev_id, key, temperature)
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
+ dev_id: str,
160
+ key: str,
161
+ temperature: float,
162
+ ) -> None:
158
163
  """Set-function placeholder for legacy devices."""
159
164
 
160
165
  async def set_preset(self, _: str, preset: str) -> None:
@@ -268,6 +273,3 @@ class SmileLegacyAPI(SmileComm, SmileLegacyData):
268
273
  )
269
274
 
270
275
  await self._request(uri, method="put", data=data)
271
-
272
- async def set_temperature_offset(self, dev_id: str, offset: float) -> None:
273
- """Set-function placeholder for legacy devices."""
@@ -182,10 +182,16 @@ 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."""
187
- if key == "max_dhw_temperature":
188
- key = "domestic_hot_water_setpoint"
185
+ async def set_number(
186
+ self,
187
+ dev_id: str,
188
+ key: str,
189
+ temperature: float,
190
+ ) -> None:
191
+ """Set the maximum boiler- or DHW-setpoint on the Central Heating boiler or the temperature-offset on a Thermostat."""
192
+ if key == "temperature_offset":
193
+ await self.set_offset(dev_id, temperature)
194
+ return
189
195
 
190
196
  temp = str(temperature)
191
197
  thermostat_id: str | None = None
@@ -202,6 +208,19 @@ class SmileAPI(SmileComm, SmileData):
202
208
  data = f"<thermostat_functionality><setpoint>{temp}</setpoint></thermostat_functionality>"
203
209
  await self._request(uri, method="put", data=data)
204
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
+
205
224
  async def set_preset(self, loc_id: str, preset: str) -> None:
206
225
  """Set the given Preset on the relevant Thermostat - from LOCATIONS."""
207
226
  if (presets := self._presets(loc_id)) is None:
@@ -413,16 +432,3 @@ class SmileAPI(SmileComm, SmileData):
413
432
  )
414
433
 
415
434
  await self._request(uri, method="put", data=data)
416
-
417
- async def set_temperature_offset(self, dev_id: str, offset: float) -> None:
418
- """Set the Temperature offset for thermostats that support this feature."""
419
- if dev_id not in self.therms_with_offset_func:
420
- raise PlugwiseError(
421
- "Plugwise: this device does not have temperature-offset capability."
422
- )
423
-
424
- value = str(offset)
425
- uri = f"{APPLIANCES};id={dev_id}/offset;type=temperature_offset"
426
- data = f"<offset_functionality><offset>{value}</offset></offset_functionality>"
427
-
428
- 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.4.1
3
+ Version: 0.37.5
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 = "0.37.4.1"
7
+ version = "0.37.5"
8
8
  license = {file = "LICENSE"}
9
9
  description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3."
10
10
  readme = "README.md"
@@ -873,14 +873,13 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
873
873
  async def tinker_max_boiler_temp(smile):
874
874
  """Change max boiler temp setpoint to test functionality."""
875
875
  new_temp = 60.0
876
- dev_id = None
877
876
  _LOGGER.info("- Adjusting temperature to %s", new_temp)
878
- for test in ["maximum_boiler_temperature", "max_dhw_temperature", "bogus_temperature"]:
877
+ for test in ["maximum_boiler_temperature", "bogus_temperature"]:
879
878
  try:
880
- await smile.set_number_setpoint(test, dev_id, new_temp)
881
- _LOGGER.info(" + tinker %s worked as intended", test)
879
+ await smile.set_number("dummy", test, new_temp)
880
+ _LOGGER.info(" + tinker_max_boiler_temp worked as intended")
882
881
  except pw_exceptions.PlugwiseError:
883
- _LOGGER.info(" + tinker %s failed as intended", test)
882
+ _LOGGER.info(" + tinker_max_boiler_temp failed as intended")
884
883
 
885
884
  @staticmethod
886
885
  async def tinker_temp_offset(smile, dev_id):
@@ -888,7 +887,7 @@ class TestPlugwise: # pylint: disable=attribute-defined-outside-init
888
887
  new_offset = 1.0
889
888
  _LOGGER.info("- Adjusting temperature offset to %s", new_offset)
890
889
  try:
891
- await smile.set_temperature_offset("dummy", dev_id, new_offset)
890
+ await smile.set_number(dev_id, "temperature_offset", new_offset)
892
891
  _LOGGER.info(" + tinker_temp_offset worked as intended")
893
892
  return True
894
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