uiprotect 1.19.1__py3-none-any.whl → 1.19.3__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/api.py +1 -18
- uiprotect/cli/base.py +0 -5
- uiprotect/data/base.py +4 -12
- uiprotect/data/bootstrap.py +1 -5
- uiprotect/data/devices.py +1 -4
- uiprotect/data/nvr.py +2 -9
- uiprotect/data/types.py +3 -12
- uiprotect/data/user.py +1 -4
- uiprotect/utils.py +2 -12
- {uiprotect-1.19.1.dist-info → uiprotect-1.19.3.dist-info}/METADATA +2 -2
- {uiprotect-1.19.1.dist-info → uiprotect-1.19.3.dist-info}/RECORD +14 -14
- {uiprotect-1.19.1.dist-info → uiprotect-1.19.3.dist-info}/LICENSE +0 -0
- {uiprotect-1.19.1.dist-info → uiprotect-1.19.3.dist-info}/WHEEL +0 -0
- {uiprotect-1.19.1.dist-info → uiprotect-1.19.3.dist-info}/entry_points.txt +0 -0
uiprotect/api.py
CHANGED
|
@@ -53,7 +53,7 @@ from .data import (
|
|
|
53
53
|
)
|
|
54
54
|
from .data.base import ProtectModelWithId
|
|
55
55
|
from .data.devices import Chime
|
|
56
|
-
from .data.types import IteratorCallback, ProgressCallback
|
|
56
|
+
from .data.types import IteratorCallback, ProgressCallback
|
|
57
57
|
from .exceptions import BadRequest, NotAuthorized, NvrError
|
|
58
58
|
from .utils import (
|
|
59
59
|
decode_token_cookie,
|
|
@@ -1123,23 +1123,6 @@ class ProtectApiClient(BaseApiClient):
|
|
|
1123
1123
|
This is a great alternative if you need metadata about the NVR without connecting to the Websocket
|
|
1124
1124
|
"""
|
|
1125
1125
|
data = await self.api_request_obj("bootstrap")
|
|
1126
|
-
# fix for UniFi Protect bug, some cameras may come back with and old recording mode
|
|
1127
|
-
# "motion" and "smartDetect" recording modes was combined into "detections" in Protect 1.20.0
|
|
1128
|
-
call_again = False
|
|
1129
|
-
for camera_dict in data["cameras"]:
|
|
1130
|
-
if camera_dict.get("recordingSettings", {}).get("mode", "detections") in {
|
|
1131
|
-
"motion",
|
|
1132
|
-
"smartDetect",
|
|
1133
|
-
}:
|
|
1134
|
-
await self.update_device(
|
|
1135
|
-
ModelType.CAMERA,
|
|
1136
|
-
camera_dict["id"],
|
|
1137
|
-
{"recordingSettings": {"mode": RecordingMode.DETECTIONS.value}},
|
|
1138
|
-
)
|
|
1139
|
-
call_again = True
|
|
1140
|
-
|
|
1141
|
-
if call_again:
|
|
1142
|
-
data = await self.api_request_obj("bootstrap")
|
|
1143
1126
|
return Bootstrap.from_unifi_dict(**data, api=self)
|
|
1144
1127
|
|
|
1145
1128
|
async def get_devices_raw(self, model_type: ModelType) -> list[dict[str, Any]]:
|
uiprotect/cli/base.py
CHANGED
|
@@ -14,11 +14,6 @@ from ..data import NVR, ProtectAdoptableDeviceModel, ProtectBaseObject
|
|
|
14
14
|
from ..exceptions import BadRequest, NvrError, StreamError
|
|
15
15
|
from ..utils import run_async
|
|
16
16
|
|
|
17
|
-
try:
|
|
18
|
-
from pydantic.v1 import ValidationError
|
|
19
|
-
except ImportError:
|
|
20
|
-
from pydantic import ValidationError # type: ignore[assignment]
|
|
21
|
-
|
|
22
17
|
T = TypeVar("T")
|
|
23
18
|
|
|
24
19
|
OPTION_FORCE = typer.Option(False, "-f", "--force", help="Skip confirmation prompt")
|
uiprotect/data/base.py
CHANGED
|
@@ -11,6 +11,9 @@ from ipaddress import IPv4Address
|
|
|
11
11
|
from typing import TYPE_CHECKING, Any, ClassVar, TypeVar
|
|
12
12
|
from uuid import UUID
|
|
13
13
|
|
|
14
|
+
from pydantic.v1 import BaseModel
|
|
15
|
+
from pydantic.v1.fields import SHAPE_DICT, SHAPE_LIST, PrivateAttr
|
|
16
|
+
|
|
14
17
|
from ..exceptions import BadRequest, ClientError, NotAuthorized
|
|
15
18
|
from ..utils import (
|
|
16
19
|
asyncio_timeout,
|
|
@@ -34,17 +37,6 @@ from .websocket import (
|
|
|
34
37
|
WSPacketFrameHeader,
|
|
35
38
|
)
|
|
36
39
|
|
|
37
|
-
try:
|
|
38
|
-
from pydantic.v1 import BaseModel
|
|
39
|
-
from pydantic.v1.fields import SHAPE_DICT, SHAPE_LIST, PrivateAttr
|
|
40
|
-
except ImportError:
|
|
41
|
-
from pydantic import BaseModel # type: ignore[assignment, no-redef]
|
|
42
|
-
from pydantic.fields import ( # type: ignore[attr-defined, assignment, no-redef]
|
|
43
|
-
SHAPE_DICT,
|
|
44
|
-
SHAPE_LIST,
|
|
45
|
-
PrivateAttr,
|
|
46
|
-
)
|
|
47
|
-
|
|
48
40
|
if TYPE_CHECKING:
|
|
49
41
|
from asyncio.events import TimerHandle
|
|
50
42
|
|
|
@@ -483,7 +475,7 @@ class ProtectBaseObject(BaseModel):
|
|
|
483
475
|
if (unifi_obj := getattr(cls, key)) is not None:
|
|
484
476
|
value = unifi_obj.update_from_dict(item)
|
|
485
477
|
else:
|
|
486
|
-
value =
|
|
478
|
+
value = unifi_objs[key](**item, api=api)
|
|
487
479
|
elif has_unifi_lists and key in unifi_lists and isinstance(item, list):
|
|
488
480
|
klass = unifi_lists[key]
|
|
489
481
|
value = [
|
uiprotect/data/bootstrap.py
CHANGED
|
@@ -10,11 +10,7 @@ from datetime import datetime
|
|
|
10
10
|
from typing import TYPE_CHECKING, Any
|
|
11
11
|
|
|
12
12
|
from aiohttp.client_exceptions import ServerDisconnectedError
|
|
13
|
-
|
|
14
|
-
try:
|
|
15
|
-
from pydantic.v1 import PrivateAttr, ValidationError
|
|
16
|
-
except ImportError:
|
|
17
|
-
from pydantic import PrivateAttr, ValidationError # type: ignore[assignment]
|
|
13
|
+
from pydantic.v1 import PrivateAttr, ValidationError
|
|
18
14
|
|
|
19
15
|
from ..exceptions import ClientError
|
|
20
16
|
from ..utils import normalize_mac, utc_now
|
uiprotect/data/devices.py
CHANGED
|
@@ -12,10 +12,7 @@ from ipaddress import IPv4Address
|
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
from typing import TYPE_CHECKING, Any, Literal, cast
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
from pydantic.v1.fields import PrivateAttr
|
|
17
|
-
except ImportError:
|
|
18
|
-
from pydantic.fields import PrivateAttr
|
|
15
|
+
from pydantic.v1.fields import PrivateAttr
|
|
19
16
|
|
|
20
17
|
from ..exceptions import BadRequest, NotAuthorized, StreamError
|
|
21
18
|
from ..stream import TalkbackStream
|
uiprotect/data/nvr.py
CHANGED
|
@@ -16,6 +16,7 @@ from uuid import UUID
|
|
|
16
16
|
import aiofiles
|
|
17
17
|
import orjson
|
|
18
18
|
from aiofiles import os as aos
|
|
19
|
+
from pydantic.v1.fields import PrivateAttr
|
|
19
20
|
|
|
20
21
|
from ..exceptions import BadRequest, NotAuthorized
|
|
21
22
|
from ..utils import RELEASE_CACHE, convert_to_datetime
|
|
@@ -58,16 +59,8 @@ from .types import (
|
|
|
58
59
|
)
|
|
59
60
|
from .user import User, UserLocation
|
|
60
61
|
|
|
61
|
-
try:
|
|
62
|
-
from pydantic.v1.fields import PrivateAttr
|
|
63
|
-
except ImportError:
|
|
64
|
-
from pydantic.fields import PrivateAttr
|
|
65
|
-
|
|
66
62
|
if TYPE_CHECKING:
|
|
67
|
-
|
|
68
|
-
from pydantic.v1.typing import SetStr
|
|
69
|
-
except ImportError:
|
|
70
|
-
from pydantic.typing import SetStr # type: ignore[assignment, no-redef]
|
|
63
|
+
from pydantic.v1.typing import SetStr
|
|
71
64
|
|
|
72
65
|
|
|
73
66
|
_LOGGER = logging.getLogger(__name__)
|
uiprotect/data/types.py
CHANGED
|
@@ -6,18 +6,9 @@ from functools import cache, cached_property
|
|
|
6
6
|
from typing import Any, Literal, Optional, TypeVar, Union
|
|
7
7
|
|
|
8
8
|
from packaging.version import Version as BaseVersion
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
from pydantic.v1.color import Color as BaseColor
|
|
13
|
-
from pydantic.v1.types import ConstrainedFloat, ConstrainedStr
|
|
14
|
-
except ImportError:
|
|
15
|
-
from pydantic import BaseModel, ConstrainedInt # type: ignore[assignment, no-redef]
|
|
16
|
-
from pydantic.color import Color as BaseColor # type: ignore[assignment, no-redef]
|
|
17
|
-
from pydantic.types import ( # type: ignore[assignment, no-redef]
|
|
18
|
-
ConstrainedFloat,
|
|
19
|
-
ConstrainedStr,
|
|
20
|
-
)
|
|
9
|
+
from pydantic.v1 import BaseModel, ConstrainedInt
|
|
10
|
+
from pydantic.v1.color import Color as BaseColor
|
|
11
|
+
from pydantic.v1.types import ConstrainedFloat, ConstrainedStr
|
|
21
12
|
|
|
22
13
|
KT = TypeVar("KT")
|
|
23
14
|
VT = TypeVar("VT")
|
uiprotect/data/user.py
CHANGED
|
@@ -6,10 +6,7 @@ from datetime import datetime
|
|
|
6
6
|
from functools import cache
|
|
7
7
|
from typing import Any
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
from pydantic.v1.fields import PrivateAttr
|
|
11
|
-
except ImportError:
|
|
12
|
-
from pydantic.fields import PrivateAttr
|
|
9
|
+
from pydantic.v1.fields import PrivateAttr
|
|
13
10
|
|
|
14
11
|
from .base import ProtectBaseObject, ProtectModel, ProtectModelWithId
|
|
15
12
|
from .types import ModelType, PermissionNode
|
uiprotect/utils.py
CHANGED
|
@@ -28,6 +28,8 @@ from uuid import UUID
|
|
|
28
28
|
|
|
29
29
|
import jwt
|
|
30
30
|
from aiohttp import ClientResponse
|
|
31
|
+
from pydantic.v1.fields import SHAPE_DICT, SHAPE_LIST, SHAPE_SET, ModelField
|
|
32
|
+
from pydantic.v1.utils import to_camel
|
|
31
33
|
|
|
32
34
|
from .data.types import (
|
|
33
35
|
Color,
|
|
@@ -38,18 +40,6 @@ from .data.types import (
|
|
|
38
40
|
)
|
|
39
41
|
from .exceptions import NvrError
|
|
40
42
|
|
|
41
|
-
try:
|
|
42
|
-
from pydantic.v1.fields import SHAPE_DICT, SHAPE_LIST, SHAPE_SET, ModelField
|
|
43
|
-
from pydantic.v1.utils import to_camel
|
|
44
|
-
except ImportError:
|
|
45
|
-
from pydantic.fields import ( # type: ignore[assignment, no-redef, attr-defined]
|
|
46
|
-
SHAPE_DICT,
|
|
47
|
-
SHAPE_LIST,
|
|
48
|
-
SHAPE_SET,
|
|
49
|
-
ModelField,
|
|
50
|
-
)
|
|
51
|
-
from pydantic.utils import to_camel # type: ignore[assignment, no-redef]
|
|
52
|
-
|
|
53
43
|
if TYPE_CHECKING:
|
|
54
44
|
from uiprotect.api import ProtectApiClient
|
|
55
45
|
from uiprotect.data import CoordType, Event
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: uiprotect
|
|
3
|
-
Version: 1.19.
|
|
3
|
+
Version: 1.19.3
|
|
4
4
|
Summary: Python API for Unifi Protect (Unofficial)
|
|
5
5
|
Home-page: https://github.com/uilibs/uiprotect
|
|
6
6
|
License: MIT
|
|
@@ -27,7 +27,7 @@ Requires-Dist: orjson (>=3.9.15)
|
|
|
27
27
|
Requires-Dist: packaging (>=23)
|
|
28
28
|
Requires-Dist: pillow (>=10)
|
|
29
29
|
Requires-Dist: platformdirs (>=4)
|
|
30
|
-
Requires-Dist: pydantic (>=1.10.
|
|
30
|
+
Requires-Dist: pydantic (>=1.10.17)
|
|
31
31
|
Requires-Dist: pyjwt (>=2.6)
|
|
32
32
|
Requires-Dist: rich (>=10)
|
|
33
33
|
Requires-Dist: typer (>=0.12.3)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
uiprotect/__init__.py,sha256=llnQNtiBfwQG8IkQXovvFz4LZeFjrJx7XdmmUhu3a9E,289
|
|
2
2
|
uiprotect/__main__.py,sha256=C_bHCOkv5qj6WMy-6ELoY3Y6HDhLxOa1a30CzmbZhsg,462
|
|
3
|
-
uiprotect/api.py,sha256=
|
|
3
|
+
uiprotect/api.py,sha256=SvAni2arXGtP8HzvTljKNLclSfzpRL03RaEF8o1o6K4,65561
|
|
4
4
|
uiprotect/cli/__init__.py,sha256=sSLW9keVQOkgFcMW18HTDjRrt9sJ0KWjn9DJDA6f9Pc,8658
|
|
5
5
|
uiprotect/cli/backup.py,sha256=ZiS7RZnJGKI8TJKLW2cOUzkRM8nyTvE5Ov_jZZGtvSM,36708
|
|
6
|
-
uiprotect/cli/base.py,sha256=
|
|
6
|
+
uiprotect/cli/base.py,sha256=k-_qGuNT7br0iV0KE5F4wYXF75iyLLjBEckTqxC71xM,7591
|
|
7
7
|
uiprotect/cli/cameras.py,sha256=YvvMccQEYG3Wih0Ix8tan1R1vfaJ6cogg6YKWLzMUV8,16973
|
|
8
8
|
uiprotect/cli/chimes.py,sha256=XANn21bQVkestkKOm9HjxSM8ZGrRrqvUXLouaQ3LTqs,5326
|
|
9
9
|
uiprotect/cli/doorlocks.py,sha256=Go_Tn68bAcmrRAnUIi4kBiR7ciKQsu_R150ubPTjUAs,3523
|
|
@@ -14,13 +14,13 @@ uiprotect/cli/nvr.py,sha256=TwxEg2XT8jXAbOqv6gc7KFXELKadeItEDYweSL4_-e8,4260
|
|
|
14
14
|
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
|
-
uiprotect/data/base.py,sha256=
|
|
18
|
-
uiprotect/data/bootstrap.py,sha256=
|
|
17
|
+
uiprotect/data/base.py,sha256=5x4YJjs4gAHKSbHts_BV9e_OYwODRRxn5Zzm35y_KOk,35460
|
|
18
|
+
uiprotect/data/bootstrap.py,sha256=aF6BJ8qgE7sEDsTKPdRXsrMsL_CTmo8Xr-TUNZjfU6I,21810
|
|
19
19
|
uiprotect/data/convert.py,sha256=8h6Il_DhMkPRDPj9F_rA2UZIlTuchS3BQD24peKpk2A,2185
|
|
20
|
-
uiprotect/data/devices.py,sha256=
|
|
21
|
-
uiprotect/data/nvr.py,sha256=
|
|
22
|
-
uiprotect/data/types.py,sha256=
|
|
23
|
-
uiprotect/data/user.py,sha256=
|
|
20
|
+
uiprotect/data/devices.py,sha256=A4ambSBi36IT9Sg_88QR0t7r1TrDBjHa4yfN5cdR8-E,110412
|
|
21
|
+
uiprotect/data/nvr.py,sha256=H0QIxwzQZJYGGeGhY_itb-WYqZnaQ_KcTlWTtrc-LLM,47456
|
|
22
|
+
uiprotect/data/types.py,sha256=3CocULpkdTgF4is1nIEDYIlwf2EOkNNM7L4kJ7NkAwM,17654
|
|
23
|
+
uiprotect/data/user.py,sha256=YvgXJKV4_y-bm0eySWz9f_ie9aR5lpVn17t9H0Pix8I,6998
|
|
24
24
|
uiprotect/data/websocket.py,sha256=vnn3FUc1H3e4dvA3INGob_asbmVCaA99H1DnwDEmpdw,6709
|
|
25
25
|
uiprotect/exceptions.py,sha256=kgn0cRM6lTtgLza09SDa3ZiX6ue1QqHCOogQ4qu6KTQ,965
|
|
26
26
|
uiprotect/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -28,10 +28,10 @@ uiprotect/release_cache.json,sha256=NamnSFy78hOWY0DPO87J9ELFCAN6NnVquv8gQO75ZG4,
|
|
|
28
28
|
uiprotect/stream.py,sha256=McV3XymKyjn-1uV5jdQHcpaDjqLS4zWyMASQ8ubcyb4,4924
|
|
29
29
|
uiprotect/test_util/__init__.py,sha256=d2g7afa0LSdixQ0kjEDYwafDFME_UlW2LzxpamZ2BC0,18556
|
|
30
30
|
uiprotect/test_util/anonymize.py,sha256=f-8ijU-_y9r-uAbhIPn0f0I6hzJpAkvJzc8UpWihObI,8478
|
|
31
|
-
uiprotect/utils.py,sha256=
|
|
31
|
+
uiprotect/utils.py,sha256=NXMLqQFiTP1rHAyNK179jWgj2O0RpUCWljaLLgg8q4M,18143
|
|
32
32
|
uiprotect/websocket.py,sha256=JHI_2EZeRPqPyQopsBZS0dr3tu0HaTiqeLazfBXhW_8,7339
|
|
33
|
-
uiprotect-1.19.
|
|
34
|
-
uiprotect-1.19.
|
|
35
|
-
uiprotect-1.19.
|
|
36
|
-
uiprotect-1.19.
|
|
37
|
-
uiprotect-1.19.
|
|
33
|
+
uiprotect-1.19.3.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
|
|
34
|
+
uiprotect-1.19.3.dist-info/METADATA,sha256=wwNTlD0-tf7_gRV0ORwawfuyUw5olAq8q6aadEwvXa4,10983
|
|
35
|
+
uiprotect-1.19.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
36
|
+
uiprotect-1.19.3.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
|
|
37
|
+
uiprotect-1.19.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|