uiprotect 3.1.8__py3-none-any.whl → 3.1.9__py3-none-any.whl

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.

@@ -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
 
@@ -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
@@ -15,7 +15,7 @@ uiprotect/cli/sensors.py,sha256=fQtcDJCVxs4VbAqcavgBy2ABiVxAW3GXtna6_XFBp2k,8153
15
15
  uiprotect/cli/viewers.py,sha256=2cyrp104ffIvgT0wYGIO0G35QMkEbFe7fSVqLwDXQYQ,2171
16
16
  uiprotect/data/__init__.py,sha256=OcfuJl2qXfHcj_mdnrHhzZ5tEIZrw8auziX5IE7dn-I,2938
17
17
  uiprotect/data/base.py,sha256=OefiljoofvG7Hp3cEp3DOabKDHW86qBXjiQnI_OUONg,35499
18
- uiprotect/data/bootstrap.py,sha256=aF6BJ8qgE7sEDsTKPdRXsrMsL_CTmo8Xr-TUNZjfU6I,21810
18
+ uiprotect/data/bootstrap.py,sha256=EWl8zWo3zSN7HWMTgcoWr3UI9WE62Mi6FJ33DTqWTII,21128
19
19
  uiprotect/data/convert.py,sha256=8h6Il_DhMkPRDPj9F_rA2UZIlTuchS3BQD24peKpk2A,2185
20
20
  uiprotect/data/devices.py,sha256=n2TVY0J-xhO7fXgrvC0hqsHjNc-B_DdySDKHOIKPeqs,110363
21
21
  uiprotect/data/nvr.py,sha256=4EzeRFogmdT96VJ9yY17rqpUMx7NuKBRnUrgRbQ5YJs,47461
@@ -30,8 +30,8 @@ uiprotect/test_util/__init__.py,sha256=whiOUb5LfDLNT3AQG6ISiKtAqO2JnhCIdFavhWDK4
30
30
  uiprotect/test_util/anonymize.py,sha256=f-8ijU-_y9r-uAbhIPn0f0I6hzJpAkvJzc8UpWihObI,8478
31
31
  uiprotect/utils.py,sha256=3SJFF8qs1Jz8t3mD8qwc1hFSocolFjdXI_v4yVlC7o4,20088
32
32
  uiprotect/websocket.py,sha256=D5DZrMzo434ecp8toNxOB5HM193kVwYw42yEcg99yMw,8029
33
- uiprotect-3.1.8.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
34
- uiprotect-3.1.8.dist-info/METADATA,sha256=jCQ1ApyriOckFH-YS0__L8A25XZbG_CtQv4P9aifOMs,10982
35
- uiprotect-3.1.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
- uiprotect-3.1.8.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
37
- uiprotect-3.1.8.dist-info/RECORD,,
33
+ uiprotect-3.1.9.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
34
+ uiprotect-3.1.9.dist-info/METADATA,sha256=Dwku5PiqpAAGuSE4lMNpd98ZEXU6aY0iwpiSpV4HMM8,10982
35
+ uiprotect-3.1.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
+ uiprotect-3.1.9.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
37
+ uiprotect-3.1.9.dist-info/RECORD,,