uiprotect 3.1.8__tar.gz → 3.1.9__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.

Potentially problematic release.


This version of uiprotect might be problematic. Click here for more details.

Files changed (36) hide show
  1. {uiprotect-3.1.8 → uiprotect-3.1.9}/PKG-INFO +1 -1
  2. {uiprotect-3.1.8 → uiprotect-3.1.9}/pyproject.toml +1 -1
  3. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/data/bootstrap.py +6 -22
  4. {uiprotect-3.1.8 → uiprotect-3.1.9}/LICENSE +0 -0
  5. {uiprotect-3.1.8 → uiprotect-3.1.9}/README.md +0 -0
  6. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/__init__.py +0 -0
  7. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/__main__.py +0 -0
  8. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/api.py +0 -0
  9. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/cli/__init__.py +0 -0
  10. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/cli/backup.py +0 -0
  11. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/cli/base.py +0 -0
  12. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/cli/cameras.py +0 -0
  13. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/cli/chimes.py +0 -0
  14. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/cli/doorlocks.py +0 -0
  15. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/cli/events.py +0 -0
  16. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/cli/lights.py +0 -0
  17. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/cli/liveviews.py +0 -0
  18. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/cli/nvr.py +0 -0
  19. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/cli/sensors.py +0 -0
  20. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/cli/viewers.py +0 -0
  21. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/data/__init__.py +0 -0
  22. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/data/base.py +0 -0
  23. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/data/convert.py +0 -0
  24. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/data/devices.py +0 -0
  25. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/data/nvr.py +0 -0
  26. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/data/types.py +0 -0
  27. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/data/user.py +0 -0
  28. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/data/websocket.py +0 -0
  29. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/exceptions.py +0 -0
  30. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/py.typed +0 -0
  31. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/release_cache.json +0 -0
  32. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/stream.py +0 -0
  33. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/test_util/__init__.py +0 -0
  34. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/test_util/anonymize.py +0 -0
  35. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/utils.py +0 -0
  36. {uiprotect-3.1.8 → uiprotect-3.1.9}/src/uiprotect/websocket.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uiprotect
3
- Version: 3.1.8
3
+ Version: 3.1.9
4
4
  Summary: Python API for Unifi Protect (Unofficial)
5
5
  Home-page: https://github.com/uilibs/uiprotect
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "uiprotect"
3
- version = "3.1.8"
3
+ version = "3.1.9"
4
4
  description = "Python API for Unifi Protect (Unofficial)"
5
5
  authors = ["UI Protect Maintainers <ui@koston.org>"]
6
6
  license = "MIT"
@@ -102,31 +102,19 @@ CAMERA_EVENT_ATTR_MAP: dict[EventType, tuple[str, str]] = {
102
102
 
103
103
 
104
104
  def _process_light_event(event: Event, light: Light) -> None:
105
- if _event_is_in_range(event, light.last_motion):
106
- light.last_motion_event_id = event.id
107
-
108
-
109
- def _event_is_in_range(event: Event, dt: datetime | None) -> bool:
110
- """Check if event is in range of datetime."""
111
- return (
112
- dt is None or event.start >= dt or (event.end is not None and event.end >= dt)
113
- )
105
+ light.last_motion_event_id = event.id
114
106
 
115
107
 
116
108
  def _process_sensor_event(event: Event, sensor: Sensor) -> None:
117
109
  if event.type is EventType.MOTION_SENSOR:
118
- if _event_is_in_range(event, sensor.motion_detected_at):
119
- sensor.last_motion_event_id = event.id
110
+ sensor.last_motion_event_id = event.id
120
111
  elif event.type in {EventType.SENSOR_CLOSED, EventType.SENSOR_OPENED}:
121
- if _event_is_in_range(event, sensor.open_status_changed_at):
122
- sensor.last_contact_event_id = event.id
112
+ sensor.last_contact_event_id = event.id
123
113
  elif event.type is EventType.SENSOR_EXTREME_VALUE:
124
- if _event_is_in_range(event, sensor.extreme_value_detected_at):
125
- sensor.extreme_value_detected_at = event.end
126
- sensor.last_value_event_id = event.id
114
+ sensor.extreme_value_detected_at = event.end
115
+ sensor.last_value_event_id = event.id
127
116
  elif event.type is EventType.SENSOR_ALARM:
128
- if _event_is_in_range(event, sensor.alarm_triggered_at):
129
- sensor.last_value_event_id = event.id
117
+ sensor.last_value_event_id = event.id
130
118
 
131
119
 
132
120
  _CAMERA_SMART_AND_LINE_EVENTS = {
@@ -139,10 +127,6 @@ _CAMERA_SMART_AUDIO_EVENT = EventType.SMART_AUDIO_DETECT
139
127
  def _process_camera_event(event: Event, camera: Camera) -> None:
140
128
  event_type = event.type
141
129
  dt_attr, event_attr = CAMERA_EVENT_ATTR_MAP[event_type]
142
- dt: datetime | None = getattr(camera, dt_attr)
143
- if not _event_is_in_range(event, dt):
144
- return
145
-
146
130
  event_id = event.id
147
131
  event_start = event.start
148
132
 
File without changes
File without changes