uiprotect 5.1.0__tar.gz → 5.2.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.
Potentially problematic release.
This version of uiprotect might be problematic. Click here for more details.
- {uiprotect-5.1.0 → uiprotect-5.2.1}/PKG-INFO +1 -1
- {uiprotect-5.1.0 → uiprotect-5.2.1}/pyproject.toml +1 -1
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/data/bootstrap.py +2 -3
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/data/devices.py +20 -5
- {uiprotect-5.1.0 → uiprotect-5.2.1}/LICENSE +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/README.md +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/__init__.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/__main__.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/api.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/cli/__init__.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/cli/backup.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/cli/base.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/cli/cameras.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/cli/chimes.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/cli/doorlocks.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/cli/events.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/cli/lights.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/cli/liveviews.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/cli/nvr.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/cli/sensors.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/cli/viewers.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/data/__init__.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/data/base.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/data/convert.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/data/nvr.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/data/types.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/data/user.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/data/websocket.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/exceptions.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/py.typed +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/release_cache.json +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/stream.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/test_util/__init__.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/test_util/anonymize.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/utils.py +0 -0
- {uiprotect-5.1.0 → uiprotect-5.2.1}/src/uiprotect/websocket.py +0 -0
|
@@ -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:
|
|
@@ -471,6 +471,20 @@ class SmartDetectSettings(ProtectBaseObject):
|
|
|
471
471
|
"autoTrackingObjectTypes": convert_smart_types,
|
|
472
472
|
} | super().unifi_dict_conversions()
|
|
473
473
|
|
|
474
|
+
def unifi_dict(
|
|
475
|
+
self,
|
|
476
|
+
data: dict[str, Any] | None = None,
|
|
477
|
+
exclude: set[str] | None = None,
|
|
478
|
+
) -> dict[str, Any]:
|
|
479
|
+
data = super().unifi_dict(data=data, exclude=exclude)
|
|
480
|
+
if audio_types := data.get("audioTypes"):
|
|
481
|
+
# SMOKE_CMONX is not supported for audio types
|
|
482
|
+
# and should not be sent to the camera
|
|
483
|
+
data["audioTypes"] = [
|
|
484
|
+
t for t in audio_types if t != SmartDetectAudioType.SMOKE_CMONX.value
|
|
485
|
+
]
|
|
486
|
+
return data
|
|
487
|
+
|
|
474
488
|
|
|
475
489
|
class LCDMessage(ProtectBaseObject):
|
|
476
490
|
type: DoorbellMessageType
|
|
@@ -1090,11 +1104,12 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1090
1104
|
return updated
|
|
1091
1105
|
|
|
1092
1106
|
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
|
-
|
|
1107
|
+
# a message in the past is actually a signal to wipe the message
|
|
1108
|
+
if (reset_at := data.get("lcd_message", {}).get("reset_at")) is not None:
|
|
1109
|
+
if utc_now() > from_js_time(reset_at):
|
|
1110
|
+
# Important: Make a copy of the data before modifying it
|
|
1111
|
+
# since unifi_dict_to_dict will otherwise report incorrect changes
|
|
1112
|
+
data = data.copy()
|
|
1098
1113
|
data["lcd_message"] = None
|
|
1099
1114
|
|
|
1100
1115
|
return super().update_from_dict(data)
|
|
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
|
|
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
|