uiprotect 1.7.2__py3-none-any.whl → 1.8.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/base.py +5 -14
- uiprotect/data/bootstrap.py +4 -9
- {uiprotect-1.7.2.dist-info → uiprotect-1.8.0.dist-info}/METADATA +1 -1
- {uiprotect-1.7.2.dist-info → uiprotect-1.8.0.dist-info}/RECORD +7 -7
- {uiprotect-1.7.2.dist-info → uiprotect-1.8.0.dist-info}/LICENSE +0 -0
- {uiprotect-1.7.2.dist-info → uiprotect-1.8.0.dist-info}/WHEEL +0 -0
- {uiprotect-1.7.2.dist-info → uiprotect-1.8.0.dist-info}/entry_points.txt +0 -0
uiprotect/data/base.py
CHANGED
|
@@ -55,13 +55,6 @@ if TYPE_CHECKING:
|
|
|
55
55
|
from ..data.nvr import Event
|
|
56
56
|
from ..data.user import User
|
|
57
57
|
|
|
58
|
-
try:
|
|
59
|
-
from pydantic.v1.typing import DictStrAny
|
|
60
|
-
except ImportError:
|
|
61
|
-
from pydantic.typing import ( # type: ignore[assignment, no-redef]
|
|
62
|
-
DictStrAny,
|
|
63
|
-
)
|
|
64
|
-
|
|
65
58
|
|
|
66
59
|
ProtectObject = TypeVar("ProtectObject", bound="ProtectBaseObject")
|
|
67
60
|
RECENT_EVENT_MAX = timedelta(seconds=30)
|
|
@@ -91,7 +84,6 @@ class ProtectBaseObject(BaseModel):
|
|
|
91
84
|
_protect_objs: ClassVar[dict[str, type[ProtectBaseObject]] | None] = None
|
|
92
85
|
_protect_lists: ClassVar[dict[str, type[ProtectBaseObject]] | None] = None
|
|
93
86
|
_protect_dicts: ClassVar[dict[str, type[ProtectBaseObject]] | None] = None
|
|
94
|
-
_to_unifi_remaps: ClassVar[DictStrAny | None] = None
|
|
95
87
|
|
|
96
88
|
class Config:
|
|
97
89
|
arbitrary_types_allowed = True
|
|
@@ -197,6 +189,7 @@ class ProtectBaseObject(BaseModel):
|
|
|
197
189
|
return set(self._get_unifi_remaps())
|
|
198
190
|
|
|
199
191
|
@classmethod
|
|
192
|
+
@cache
|
|
200
193
|
def _get_to_unifi_remaps(cls) -> dict[str, str]:
|
|
201
194
|
"""
|
|
202
195
|
Helper method for overriding in child classes for reversing remap UFP
|
|
@@ -208,12 +201,9 @@ class ProtectBaseObject(BaseModel):
|
|
|
208
201
|
"python_name": "ufpJsonName"
|
|
209
202
|
}
|
|
210
203
|
"""
|
|
211
|
-
|
|
212
|
-
cls.
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return cls._to_unifi_remaps
|
|
204
|
+
return {
|
|
205
|
+
to_key: from_key for from_key, to_key in cls._get_unifi_remaps().items()
|
|
206
|
+
}
|
|
217
207
|
|
|
218
208
|
@classmethod
|
|
219
209
|
def _set_protect_subtypes(cls) -> None:
|
|
@@ -630,6 +620,7 @@ class ProtectModelWithId(ProtectModel):
|
|
|
630
620
|
return obj
|
|
631
621
|
|
|
632
622
|
@classmethod
|
|
623
|
+
@cache
|
|
633
624
|
def _get_read_only_fields(cls) -> set[str]:
|
|
634
625
|
return set()
|
|
635
626
|
|
uiprotect/data/bootstrap.py
CHANGED
|
@@ -154,10 +154,6 @@ class ProtectDeviceRef(ProtectBaseObject):
|
|
|
154
154
|
id: str
|
|
155
155
|
|
|
156
156
|
|
|
157
|
-
_ModelType_NVR_value = ModelType.NVR.value
|
|
158
|
-
_ModelType_Event_value = ModelType.EVENT.value
|
|
159
|
-
|
|
160
|
-
|
|
161
157
|
class Bootstrap(ProtectBaseObject):
|
|
162
158
|
auth_user_id: str
|
|
163
159
|
access_key: str
|
|
@@ -360,14 +356,13 @@ class Bootstrap(ProtectBaseObject):
|
|
|
360
356
|
elif model_type in ModelType.bootstrap_models_types_set():
|
|
361
357
|
if TYPE_CHECKING:
|
|
362
358
|
assert isinstance(obj, ProtectAdoptableDeviceModel)
|
|
363
|
-
assert isinstance(obj.model, ModelType)
|
|
364
|
-
key = obj.model.devices_key
|
|
365
359
|
if not self._api.ignore_unadopted or (
|
|
366
360
|
obj.is_adopted and not obj.is_adopted_by_other
|
|
367
361
|
):
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
362
|
+
id_ = obj.id
|
|
363
|
+
getattr(self, model_type.devices_key)[id_] = obj
|
|
364
|
+
ref = ProtectDeviceRef(model=model_type, id=id_)
|
|
365
|
+
self.id_lookup[id_] = ref
|
|
371
366
|
self.mac_lookup[normalize_mac(obj.mac)] = ref
|
|
372
367
|
else:
|
|
373
368
|
_LOGGER.debug("Unexpected bootstrap model type for add: %s", model_type)
|
|
@@ -14,8 +14,8 @@ 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=apIXKZHL6dbyXTT4C4lkyo4M-Nf_DwsVXoXBL5jcXVo,37574
|
|
18
|
+
uiprotect/data/bootstrap.py,sha256=tgB5AdJhWQp3nJA_dU4glLV4kEVZZJHDR8_m-7J2ANU,21320
|
|
19
19
|
uiprotect/data/convert.py,sha256=8h6Il_DhMkPRDPj9F_rA2UZIlTuchS3BQD24peKpk2A,2185
|
|
20
20
|
uiprotect/data/devices.py,sha256=Nq3bOko5PFf5LvEBoD4JV8kmbq50laRdh3VHMWX7t-0,111809
|
|
21
21
|
uiprotect/data/nvr.py,sha256=XC4NO1c_Mom-hIpzj9ksKFcgKbHd6ToqWjkgzxJ1PJY,47636
|
|
@@ -30,8 +30,8 @@ uiprotect/test_util/__init__.py,sha256=d2g7afa0LSdixQ0kjEDYwafDFME_UlW2LzxpamZ2B
|
|
|
30
30
|
uiprotect/test_util/anonymize.py,sha256=f-8ijU-_y9r-uAbhIPn0f0I6hzJpAkvJzc8UpWihObI,8478
|
|
31
31
|
uiprotect/utils.py,sha256=6OLY8hNiCzk418PjJJIlFW7jjPzVt1vxBKEzBSqMeTk,18418
|
|
32
32
|
uiprotect/websocket.py,sha256=IzDPyqbzrkOMREvahN-e2zdvVD0VABSCWy6jSoCwOT0,7299
|
|
33
|
-
uiprotect-1.
|
|
34
|
-
uiprotect-1.
|
|
35
|
-
uiprotect-1.
|
|
36
|
-
uiprotect-1.
|
|
37
|
-
uiprotect-1.
|
|
33
|
+
uiprotect-1.8.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
|
|
34
|
+
uiprotect-1.8.0.dist-info/METADATA,sha256=chTjPXx0m3ZgW9MC7q71DIq2Z1opdcOp2OKmWjGCE8M,10984
|
|
35
|
+
uiprotect-1.8.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
36
|
+
uiprotect-1.8.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
|
|
37
|
+
uiprotect-1.8.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|