uiprotect 5.2.1__tar.gz → 5.2.2__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.2.1 → uiprotect-5.2.2}/PKG-INFO +1 -1
- {uiprotect-5.2.1 → uiprotect-5.2.2}/pyproject.toml +1 -1
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/data/devices.py +18 -6
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/utils.py +5 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/LICENSE +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/README.md +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/__init__.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/__main__.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/api.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/cli/__init__.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/cli/backup.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/cli/base.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/cli/cameras.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/cli/chimes.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/cli/doorlocks.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/cli/events.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/cli/lights.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/cli/liveviews.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/cli/nvr.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/cli/sensors.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/cli/viewers.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/data/__init__.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/data/base.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/data/bootstrap.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/data/convert.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/data/nvr.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/data/types.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/data/user.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/data/websocket.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/exceptions.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/py.typed +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/release_cache.json +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/stream.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/test_util/__init__.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/test_util/anonymize.py +0 -0
- {uiprotect-5.2.1 → uiprotect-5.2.2}/src/uiprotect/websocket.py +0 -0
|
@@ -7,7 +7,7 @@ import logging
|
|
|
7
7
|
import warnings
|
|
8
8
|
from collections.abc import Callable
|
|
9
9
|
from datetime import datetime, timedelta
|
|
10
|
-
from functools import cache
|
|
10
|
+
from functools import cache, lru_cache
|
|
11
11
|
from ipaddress import IPv4Address
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
from typing import TYPE_CHECKING, Any, Literal, cast
|
|
@@ -25,6 +25,7 @@ from ..utils import (
|
|
|
25
25
|
convert_video_modes,
|
|
26
26
|
from_js_time,
|
|
27
27
|
serialize_point,
|
|
28
|
+
timedelta_total_seconds,
|
|
28
29
|
to_js_time,
|
|
29
30
|
utc_now,
|
|
30
31
|
)
|
|
@@ -900,6 +901,15 @@ class CameraAudioSettings(ProtectBaseObject):
|
|
|
900
901
|
style: list[AudioStyle]
|
|
901
902
|
|
|
902
903
|
|
|
904
|
+
@lru_cache
|
|
905
|
+
def _chime_type_from_total_seconds(total_seconds: float) -> ChimeType:
|
|
906
|
+
if total_seconds == 0.3:
|
|
907
|
+
return ChimeType.MECHANICAL
|
|
908
|
+
if total_seconds > 0.3:
|
|
909
|
+
return ChimeType.DIGITAL
|
|
910
|
+
return ChimeType.NONE
|
|
911
|
+
|
|
912
|
+
|
|
903
913
|
class Camera(ProtectMotionDeviceModel):
|
|
904
914
|
is_deleting: bool
|
|
905
915
|
# Microphone Sensitivity
|
|
@@ -1855,11 +1865,13 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1855
1865
|
|
|
1856
1866
|
@property
|
|
1857
1867
|
def chime_type(self) -> ChimeType:
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1868
|
+
return _chime_type_from_total_seconds(
|
|
1869
|
+
timedelta_total_seconds(self.chime_duration)
|
|
1870
|
+
)
|
|
1871
|
+
|
|
1872
|
+
@property
|
|
1873
|
+
def chime_duration_seconds(self) -> float:
|
|
1874
|
+
return timedelta_total_seconds(self.chime_duration)
|
|
1863
1875
|
|
|
1864
1876
|
@property
|
|
1865
1877
|
def is_digital_chime(self) -> bool:
|
|
@@ -670,3 +670,8 @@ def make_required_getter(ufp_required_field: str) -> Callable[[T], bool]:
|
|
|
670
670
|
if "." not in ufp_required_field:
|
|
671
671
|
return partial(get_top_level_attr_as_bool, ufp_required_field)
|
|
672
672
|
return partial(get_nested_attr_as_bool, tuple(ufp_required_field.split(".")))
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
@lru_cache
|
|
676
|
+
def timedelta_total_seconds(td: timedelta) -> float:
|
|
677
|
+
return td.total_seconds()
|
|
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
|