pyg90alarm 1.17.0__tar.gz → 1.17.1__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 (57) hide show
  1. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/PKG-INFO +1 -1
  2. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/alarm.py +4 -1
  3. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/device_notifications.py +7 -3
  4. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm.egg-info/PKG-INFO +1 -1
  5. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/tests/test_history.py +7 -0
  6. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/.github/CODEOWNERS +0 -0
  7. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/.github/workflows/main.yml +0 -0
  8. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/.gitignore +0 -0
  9. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/.pylintrc +0 -0
  10. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/.readthedocs.yaml +0 -0
  11. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/LICENSE +0 -0
  12. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/MANIFEST.in +0 -0
  13. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/README.rst +0 -0
  14. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/docs/.DS_Store +0 -0
  15. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/docs/.gitignore +0 -0
  16. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/docs/api-docs.rst +0 -0
  17. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/docs/conf.py +0 -0
  18. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/docs/index.rst +0 -0
  19. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/docs/protocol.rst +0 -0
  20. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/docs/requirements.txt +0 -0
  21. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/pyproject.toml +0 -0
  22. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/setup.cfg +0 -0
  23. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/setup.py +0 -0
  24. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/sonar-project.properties +0 -0
  25. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/__init__.py +0 -0
  26. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/base_cmd.py +0 -0
  27. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/callback.py +0 -0
  28. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/config.py +0 -0
  29. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/const.py +0 -0
  30. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/definitions/__init__.py +0 -0
  31. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/definitions/sensors.py +0 -0
  32. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/discovery.py +0 -0
  33. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/entities/__init__.py +0 -0
  34. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/entities/device.py +0 -0
  35. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/entities/sensor.py +0 -0
  36. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/exceptions.py +0 -0
  37. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/history.py +0 -0
  38. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/host_info.py +0 -0
  39. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/host_status.py +0 -0
  40. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/paginated_cmd.py +0 -0
  41. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/paginated_result.py +0 -0
  42. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/py.typed +0 -0
  43. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/targeted_discovery.py +0 -0
  44. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm/user_data_crc.py +0 -0
  45. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm.egg-info/SOURCES.txt +0 -0
  46. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm.egg-info/dependency_links.txt +0 -0
  47. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm.egg-info/requires.txt +0 -0
  48. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/src/pyg90alarm.egg-info/top_level.txt +0 -0
  49. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/tests/__init__.py +0 -0
  50. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/tests/conftest.py +0 -0
  51. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/tests/device_mock.py +0 -0
  52. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/tests/test_alarm.py +0 -0
  53. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/tests/test_base_commands.py +0 -0
  54. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/tests/test_discovery.py +0 -0
  55. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/tests/test_notifications.py +0 -0
  56. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/tests/test_paginated_commands.py +0 -0
  57. {pyg90alarm-1.17.0 → pyg90alarm-1.17.1}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyg90alarm
3
- Version: 1.17.0
3
+ Version: 1.17.1
4
4
  Summary: G90 Alarm system protocol
5
5
  Home-page: https://github.com/hostcc/pyg90alarm
6
6
  Author: Ilia Sotnikov
@@ -915,7 +915,10 @@ class G90Alarm(G90DeviceNotifications):
915
915
  # notifications port
916
916
  self._handle_alert(
917
917
  (self._host, self._notifications_local_port),
918
- item.as_device_alert()
918
+ item.as_device_alert(),
919
+ # Skip verifying device GUID, since history entry
920
+ # don't have it
921
+ verify_device_id=False
919
922
  )
920
923
 
921
924
  # Record the entry as most recent one
@@ -208,13 +208,17 @@ class G90DeviceNotifications(DatagramProtocol):
208
208
  return False
209
209
 
210
210
  def _handle_alert(
211
- self, addr: Tuple[str, int], alert: G90DeviceAlert
211
+ self, addr: Tuple[str, int], alert: G90DeviceAlert,
212
+ verify_device_id: bool = True
212
213
  ) -> None:
213
214
  handled = False
214
215
 
215
216
  # Stop processing when alert is received from the device with different
216
- # GUID
217
- if self.device_id and alert.device_id != self.device_id:
217
+ # GUID (if enabled)
218
+ if (
219
+ verify_device_id and self.device_id
220
+ and alert.device_id != self.device_id
221
+ ):
218
222
  _LOGGER.error(
219
223
  "Received alert from wrong device: expected '%s', got '%s'",
220
224
  self.device_id, alert.device_id
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyg90alarm
3
- Version: 1.17.0
3
+ Version: 1.17.1
4
4
  Summary: G90 Alarm system protocol
5
5
  Home-page: https://github.com/hostcc/pyg90alarm
6
6
  Author: Ilia Sotnikov
@@ -135,6 +135,10 @@ async def test_history_parsing_error(mock_device: DeviceMock) -> None:
135
135
 
136
136
 
137
137
  @pytest.mark.g90device(sent_data=[
138
+ # Host info
139
+ b'ISTART[206,'
140
+ b'["DUMMYGUID","DUMMYPRODUCT",'
141
+ b'"1.2","1.1","206","206",3,3,0,2,"4242",50,100]]IEND\0',
138
142
  # Simulate empty history initially
139
143
  b'ISTART[200,[[0,0,0]]]IEND\0',
140
144
  # The history records will be used to remember the timestamp of most recent
@@ -173,6 +177,9 @@ async def test_simulate_alerts_from_history(mock_device: DeviceMock) -> None:
173
177
  armdisarm_cb.side_effect = lambda *args: future_armdisarm.set_result(True)
174
178
 
175
179
  g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
180
+ # Call the method to store device GUID, so that its validation in
181
+ # `G90DeviceNotifications._handle_alert()` is involved
182
+ await g90.get_host_info()
176
183
  g90.alarm_callback = alarm_cb
177
184
  g90.armdisarm_callback = armdisarm_cb
178
185
  # Simulate device timeout exception every 2nd call to `G90Alarm.history()`
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