uiprotect 5.0.0__py3-none-any.whl → 5.2.0__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.
- uiprotect/data/bootstrap.py +2 -3
- uiprotect/data/devices.py +16 -16
- {uiprotect-5.0.0.dist-info → uiprotect-5.2.0.dist-info}/METADATA +1 -1
- {uiprotect-5.0.0.dist-info → uiprotect-5.2.0.dist-info}/RECORD +7 -7
- {uiprotect-5.0.0.dist-info → uiprotect-5.2.0.dist-info}/LICENSE +0 -0
- {uiprotect-5.0.0.dist-info → uiprotect-5.2.0.dist-info}/WHEEL +0 -0
- {uiprotect-5.0.0.dist-info → uiprotect-5.2.0.dist-info}/entry_points.txt +0 -0
uiprotect/data/bootstrap.py
CHANGED
|
@@ -4,7 +4,6 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import asyncio
|
|
6
6
|
import logging
|
|
7
|
-
from copy import deepcopy
|
|
8
7
|
from dataclasses import dataclass
|
|
9
8
|
from datetime import datetime
|
|
10
9
|
from typing import TYPE_CHECKING, Any
|
|
@@ -399,7 +398,7 @@ class Bootstrap(ProtectBaseObject):
|
|
|
399
398
|
return None
|
|
400
399
|
|
|
401
400
|
old_nvr = self.nvr.copy()
|
|
402
|
-
self.nvr = self.nvr.update_from_dict(
|
|
401
|
+
self.nvr = self.nvr.update_from_dict(data)
|
|
403
402
|
|
|
404
403
|
return WSSubscriptionMessage(
|
|
405
404
|
action=WSAction.UPDATE,
|
|
@@ -455,7 +454,7 @@ class Bootstrap(ProtectBaseObject):
|
|
|
455
454
|
return None
|
|
456
455
|
|
|
457
456
|
old_obj = obj.copy()
|
|
458
|
-
obj = obj.update_from_dict(
|
|
457
|
+
obj = obj.update_from_dict(data)
|
|
459
458
|
|
|
460
459
|
if model_type is ModelType.EVENT:
|
|
461
460
|
if TYPE_CHECKING:
|
uiprotect/data/devices.py
CHANGED
|
@@ -1090,11 +1090,12 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1090
1090
|
return updated
|
|
1091
1091
|
|
|
1092
1092
|
def update_from_dict(self, data: dict[str, Any]) -> Camera:
|
|
1093
|
-
# a message in the past is actually a
|
|
1094
|
-
reset_at
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1093
|
+
# a message in the past is actually a signal to wipe the message
|
|
1094
|
+
if (reset_at := data.get("lcd_message", {}).get("reset_at")) is not None:
|
|
1095
|
+
if utc_now() > from_js_time(reset_at):
|
|
1096
|
+
# Important: Make a copy of the data before modifying it
|
|
1097
|
+
# since unifi_dict_to_dict will otherwise report incorrect changes
|
|
1098
|
+
data = data.copy()
|
|
1098
1099
|
data["lcd_message"] = None
|
|
1099
1100
|
|
|
1100
1101
|
return super().update_from_dict(data)
|
|
@@ -1134,11 +1135,9 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1134
1135
|
smart_type: SmartDetectObjectType,
|
|
1135
1136
|
) -> Event | None:
|
|
1136
1137
|
"""Get the last smart detect event for given type."""
|
|
1137
|
-
event_id
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
return self._api.bootstrap.events.get(event_id)
|
|
1138
|
+
if event_id := self.last_smart_detect_event_ids.get(smart_type):
|
|
1139
|
+
return self._api.bootstrap.events.get(event_id)
|
|
1140
|
+
return None
|
|
1142
1141
|
|
|
1143
1142
|
@property
|
|
1144
1143
|
def last_smart_audio_detect_event(self) -> Event | None:
|
|
@@ -1222,19 +1221,20 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1222
1221
|
"""Get active smart detection types."""
|
|
1223
1222
|
if self.use_global:
|
|
1224
1223
|
return set(self.smart_detect_settings.object_types).intersection(
|
|
1225
|
-
self.feature_flags.smart_detect_types
|
|
1224
|
+
self.feature_flags.smart_detect_types
|
|
1226
1225
|
)
|
|
1227
1226
|
return set(self.smart_detect_settings.object_types)
|
|
1228
1227
|
|
|
1229
1228
|
@property
|
|
1230
1229
|
def active_audio_detect_types(self) -> set[SmartDetectAudioType]:
|
|
1231
1230
|
"""Get active audio detection types."""
|
|
1231
|
+
if not (enabled_audio_types := self.smart_detect_settings.audio_types):
|
|
1232
|
+
return set()
|
|
1232
1233
|
if self.use_global:
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
)
|
|
1236
|
-
|
|
1237
|
-
return set(self.smart_detect_settings.audio_types or [])
|
|
1234
|
+
if not (feature_audio_types := self.feature_flags.smart_detect_audio_types):
|
|
1235
|
+
return set()
|
|
1236
|
+
return set(feature_audio_types).intersection(enabled_audio_types)
|
|
1237
|
+
return set(enabled_audio_types)
|
|
1238
1238
|
|
|
1239
1239
|
@property
|
|
1240
1240
|
def is_motion_detection_on(self) -> bool:
|
|
@@ -15,9 +15,9 @@ 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=J2ytJqWJIsFq7vXYG4gfp2c-mrj5gqa3UhmItF0MWbI,35033
|
|
18
|
-
uiprotect/data/bootstrap.py,sha256=
|
|
18
|
+
uiprotect/data/bootstrap.py,sha256=OSPHu08p7Ys9KqEb8sq_LFufuECtF4lY7OnAYK27ngo,20454
|
|
19
19
|
uiprotect/data/convert.py,sha256=8h6Il_DhMkPRDPj9F_rA2UZIlTuchS3BQD24peKpk2A,2185
|
|
20
|
-
uiprotect/data/devices.py,sha256=
|
|
20
|
+
uiprotect/data/devices.py,sha256=aMGxB-6iX9kduYNQj4PKhS1oI76POiXz5gWECEcZCQM,110062
|
|
21
21
|
uiprotect/data/nvr.py,sha256=8M-62AG4q1k71eX-DaFcdO52QWG4zO9X5Voj0Tj9D5A,46598
|
|
22
22
|
uiprotect/data/types.py,sha256=3CocULpkdTgF4is1nIEDYIlwf2EOkNNM7L4kJ7NkAwM,17654
|
|
23
23
|
uiprotect/data/user.py,sha256=YvgXJKV4_y-bm0eySWz9f_ie9aR5lpVn17t9H0Pix8I,6998
|
|
@@ -30,8 +30,8 @@ uiprotect/test_util/__init__.py,sha256=Ky8mTL61nhp5II2mxTKBAsSGvNqK8U_CfKC5AGwTo
|
|
|
30
30
|
uiprotect/test_util/anonymize.py,sha256=f-8ijU-_y9r-uAbhIPn0f0I6hzJpAkvJzc8UpWihObI,8478
|
|
31
31
|
uiprotect/utils.py,sha256=9ny9-GMn5Fpnxaw9i769VTIDp4ntfgiCCItqJYWepns,19769
|
|
32
32
|
uiprotect/websocket.py,sha256=D5DZrMzo434ecp8toNxOB5HM193kVwYw42yEcg99yMw,8029
|
|
33
|
-
uiprotect-5.
|
|
34
|
-
uiprotect-5.
|
|
35
|
-
uiprotect-5.
|
|
36
|
-
uiprotect-5.
|
|
37
|
-
uiprotect-5.
|
|
33
|
+
uiprotect-5.2.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
|
|
34
|
+
uiprotect-5.2.0.dist-info/METADATA,sha256=vUJTI2o1QhkwEAiIn4DYbAWy36F-a8cJeOFr-IHmLh8,11009
|
|
35
|
+
uiprotect-5.2.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
36
|
+
uiprotect-5.2.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
|
|
37
|
+
uiprotect-5.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|