plugwise 1.1.0__tar.gz → 1.2.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.1.0 → plugwise-1.2.0}/PKG-INFO +1 -1
  2. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise/data.py +6 -7
  3. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise.egg-info/PKG-INFO +1 -1
  4. {plugwise-1.1.0 → plugwise-1.2.0}/pyproject.toml +2 -2
  5. {plugwise-1.1.0 → plugwise-1.2.0}/LICENSE +0 -0
  6. {plugwise-1.1.0 → plugwise-1.2.0}/README.md +0 -0
  7. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise/__init__.py +0 -0
  8. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise/common.py +0 -0
  9. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise/constants.py +0 -0
  10. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise/exceptions.py +0 -0
  11. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise/helper.py +0 -0
  12. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise/legacy/data.py +0 -0
  13. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise/legacy/helper.py +0 -0
  14. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise/legacy/smile.py +0 -0
  15. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise/py.typed +0 -0
  16. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise/smile.py +0 -0
  17. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise/util.py +0 -0
  18. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise.egg-info/SOURCES.txt +0 -0
  19. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise.egg-info/dependency_links.txt +0 -0
  20. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise.egg-info/requires.txt +0 -0
  21. {plugwise-1.1.0 → plugwise-1.2.0}/plugwise.egg-info/top_level.txt +0 -0
  22. {plugwise-1.1.0 → plugwise-1.2.0}/setup.cfg +0 -0
  23. {plugwise-1.1.0 → plugwise-1.2.0}/setup.py +0 -0
  24. {plugwise-1.1.0 → plugwise-1.2.0}/tests/test_adam.py +0 -0
  25. {plugwise-1.1.0 → plugwise-1.2.0}/tests/test_anna.py +0 -0
  26. {plugwise-1.1.0 → plugwise-1.2.0}/tests/test_generic.py +0 -0
  27. {plugwise-1.1.0 → plugwise-1.2.0}/tests/test_init.py +0 -0
  28. {plugwise-1.1.0 → plugwise-1.2.0}/tests/test_legacy_anna.py +0 -0
  29. {plugwise-1.1.0 → plugwise-1.2.0}/tests/test_legacy_generic.py +0 -0
  30. {plugwise-1.1.0 → plugwise-1.2.0}/tests/test_legacy_p1.py +0 -0
  31. {plugwise-1.1.0 → plugwise-1.2.0}/tests/test_legacy_stretch.py +0 -0
  32. {plugwise-1.1.0 → plugwise-1.2.0}/tests/test_p1.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugwise
3
- Version: 1.1.0
3
+ Version: 1.2.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
@@ -62,15 +62,11 @@ class SmileData(SmileHelper):
62
62
  self._add_or_update_notifications(device_id, device, data)
63
63
 
64
64
  device.update(data)
65
-
66
65
  is_battery_low = (
67
66
  mac_list
68
67
  and "low_battery" in device["binary_sensors"]
69
68
  and device["zigbee_mac_address"] in mac_list
70
- and (
71
- (device["dev_class"] in ("thermo_sensor", "thermostatic_radiator_valve") and device["sensors"]["battery"] < 30)
72
- or (device["dev_class"] in ("zone_thermometer", "zone_thermostat") and device["sensors"]["battery"] < 15)
73
- )
69
+ and device["dev_class"] in ("thermo_sensor", "thermostatic_radiator_valve", "zone_thermometer", "zone_thermostat")
74
70
  )
75
71
  if is_battery_low:
76
72
  device["binary_sensors"]["low_battery"] = True
@@ -88,12 +84,15 @@ class SmileData(SmileHelper):
88
84
  for msg_id, notification in list(self._notifications.items()):
89
85
  mac_address: str | None = None
90
86
  message: str | None = notification.get("message")
91
- if message is not None and all(x in message for x in matches) and (mac_addresses := mac_pattern.findall(message)):
87
+ warning: str | None = notification.get("warning")
88
+ notify = message or warning
89
+ if notify is not None and all(x in notify for x in matches) and (mac_addresses := mac_pattern.findall(notify)):
92
90
  mac_address = mac_addresses[0] # re.findall() outputs a list
93
91
 
94
92
  if mac_address is not None:
95
- self._notifications.pop(msg_id)
96
93
  mac_address_list.append(mac_address)
94
+ if message is not None: # only block message-type notifications
95
+ self._notifications.pop(msg_id)
97
96
 
98
97
  return mac_address_list
99
98
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugwise
3
- Version: 1.1.0
3
+ Version: 1.2.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
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["setuptools~=72.1", "wheel~=0.44.0"]
2
+ requires = ["setuptools~=73.0", "wheel~=0.44.0"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "plugwise"
7
- version = "1.1.0"
7
+ version = "1.2.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"
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
File without changes
File without changes