uiprotect 1.8.0__py3-none-any.whl → 1.9.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 +6 -6
- uiprotect/data/types.py +33 -19
- {uiprotect-1.8.0.dist-info → uiprotect-1.9.0.dist-info}/METADATA +1 -1
- {uiprotect-1.8.0.dist-info → uiprotect-1.9.0.dist-info}/RECORD +7 -7
- {uiprotect-1.8.0.dist-info → uiprotect-1.9.0.dist-info}/LICENSE +0 -0
- {uiprotect-1.8.0.dist-info → uiprotect-1.9.0.dist-info}/WHEEL +0 -0
- {uiprotect-1.8.0.dist-info → uiprotect-1.9.0.dist-info}/entry_points.txt +0 -0
uiprotect/data/bootstrap.py
CHANGED
|
@@ -193,8 +193,8 @@ class Bootstrap(ProtectBaseObject):
|
|
|
193
193
|
)
|
|
194
194
|
data["macLookup"] = {}
|
|
195
195
|
data["idLookup"] = {}
|
|
196
|
-
for model_type in ModelType.bootstrap_models_types_set
|
|
197
|
-
key = model_type.devices_key
|
|
196
|
+
for model_type in ModelType.bootstrap_models_types_set:
|
|
197
|
+
key = model_type.devices_key # type: ignore[attr-defined]
|
|
198
198
|
items: dict[str, ProtectModel] = {}
|
|
199
199
|
for item in data[key]:
|
|
200
200
|
if (
|
|
@@ -230,8 +230,8 @@ class Bootstrap(ProtectBaseObject):
|
|
|
230
230
|
if "idLookup" in data:
|
|
231
231
|
del data["idLookup"]
|
|
232
232
|
|
|
233
|
-
for model_type in ModelType.bootstrap_models_types_set
|
|
234
|
-
attr = model_type.devices_key
|
|
233
|
+
for model_type in ModelType.bootstrap_models_types_set:
|
|
234
|
+
attr = model_type.devices_key # type: ignore[attr-defined]
|
|
235
235
|
if attr in data and isinstance(data[attr], dict):
|
|
236
236
|
data[attr] = list(data[attr].values())
|
|
237
237
|
|
|
@@ -353,7 +353,7 @@ class Bootstrap(ProtectBaseObject):
|
|
|
353
353
|
if TYPE_CHECKING:
|
|
354
354
|
assert isinstance(obj, NVR)
|
|
355
355
|
self.nvr = obj
|
|
356
|
-
elif model_type in ModelType.bootstrap_models_types_set
|
|
356
|
+
elif model_type in ModelType.bootstrap_models_types_set:
|
|
357
357
|
if TYPE_CHECKING:
|
|
358
358
|
assert isinstance(obj, ProtectAdoptableDeviceModel)
|
|
359
359
|
if not self._api.ignore_unadopted or (
|
|
@@ -550,7 +550,7 @@ class Bootstrap(ProtectBaseObject):
|
|
|
550
550
|
if action_action == "update":
|
|
551
551
|
if model_type is ModelType.NVR:
|
|
552
552
|
return self._process_nvr_update(packet, data, ignore_stats)
|
|
553
|
-
if model_type in ModelType.bootstrap_models_types_and_event_set
|
|
553
|
+
if model_type in ModelType.bootstrap_models_types_and_event_set:
|
|
554
554
|
return self._process_device_update(
|
|
555
555
|
model_type,
|
|
556
556
|
packet,
|
uiprotect/data/types.py
CHANGED
|
@@ -109,6 +109,12 @@ class ModelType(str, UnknownValuesEnumMixin, enum.Enum):
|
|
|
109
109
|
RECORDING_SCHEDULE = "recordingSchedule"
|
|
110
110
|
UNKNOWN = "unknown"
|
|
111
111
|
|
|
112
|
+
bootstrap_model_types: tuple[ModelType, ...]
|
|
113
|
+
bootstrap_models: tuple[str, ...]
|
|
114
|
+
bootstrap_models_set: set[str]
|
|
115
|
+
bootstrap_models_types_set: set[ModelType]
|
|
116
|
+
bootstrap_models_types_and_event_set: set[ModelType]
|
|
117
|
+
|
|
112
118
|
@cached_property
|
|
113
119
|
def devices_key(self) -> str:
|
|
114
120
|
"""Return the devices key."""
|
|
@@ -119,9 +125,8 @@ class ModelType(str, UnknownValuesEnumMixin, enum.Enum):
|
|
|
119
125
|
def from_string(cls, value: str) -> ModelType:
|
|
120
126
|
return cls(value)
|
|
121
127
|
|
|
122
|
-
@
|
|
123
|
-
|
|
124
|
-
def bootstrap_model_types() -> tuple[ModelType, ...]:
|
|
128
|
+
@classmethod
|
|
129
|
+
def _bootstrap_model_types(cls) -> tuple[ModelType, ...]:
|
|
125
130
|
"""Return the bootstrap models as a tuple."""
|
|
126
131
|
# TODO:
|
|
127
132
|
# legacyUFV
|
|
@@ -139,31 +144,40 @@ class ModelType(str, UnknownValuesEnumMixin, enum.Enum):
|
|
|
139
144
|
ModelType.CHIME,
|
|
140
145
|
)
|
|
141
146
|
|
|
142
|
-
@
|
|
143
|
-
|
|
144
|
-
def bootstrap_models() -> tuple[str, ...]:
|
|
147
|
+
@classmethod
|
|
148
|
+
def _bootstrap_models(cls) -> tuple[str, ...]:
|
|
145
149
|
"""Return the bootstrap models strings as a tuple."""
|
|
146
150
|
return tuple(
|
|
147
|
-
model_type.value for model_type in ModelType.
|
|
151
|
+
model_type.value for model_type in ModelType._bootstrap_model_types()
|
|
148
152
|
)
|
|
149
153
|
|
|
150
|
-
@
|
|
151
|
-
|
|
152
|
-
def bootstrap_models_set() -> set[str]:
|
|
154
|
+
@classmethod
|
|
155
|
+
def _bootstrap_models_set(cls) -> set[str]:
|
|
153
156
|
"""Return the set of bootstrap models strings as a set."""
|
|
154
|
-
return set(ModelType.
|
|
157
|
+
return set(ModelType._bootstrap_models())
|
|
155
158
|
|
|
156
|
-
@
|
|
157
|
-
|
|
158
|
-
def bootstrap_models_types_set() -> set[ModelType]:
|
|
159
|
+
@classmethod
|
|
160
|
+
def _bootstrap_models_types_set(cls) -> set[ModelType]:
|
|
159
161
|
"""Return the set of bootstrap models as a set."""
|
|
160
|
-
return set(ModelType.
|
|
162
|
+
return set(ModelType._bootstrap_model_types())
|
|
161
163
|
|
|
162
|
-
@
|
|
163
|
-
|
|
164
|
-
def bootstrap_models_types_and_event_set() -> set[ModelType]:
|
|
164
|
+
@classmethod
|
|
165
|
+
def _bootstrap_models_types_and_event_set(cls) -> set[ModelType]:
|
|
165
166
|
"""Return the set of bootstrap models and the event model as a set."""
|
|
166
|
-
return ModelType.
|
|
167
|
+
return ModelType._bootstrap_models_types_set() | {ModelType.EVENT}
|
|
168
|
+
|
|
169
|
+
def _immutable(self, name: str, value: Any) -> None:
|
|
170
|
+
raise AttributeError("Cannot modify ModelType")
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
ModelType.bootstrap_model_types = ModelType._bootstrap_model_types()
|
|
174
|
+
ModelType.bootstrap_models = ModelType._bootstrap_models()
|
|
175
|
+
ModelType.bootstrap_models_set = ModelType._bootstrap_models_set()
|
|
176
|
+
ModelType.bootstrap_models_types_set = ModelType._bootstrap_models_types_set()
|
|
177
|
+
ModelType.bootstrap_models_types_and_event_set = (
|
|
178
|
+
ModelType._bootstrap_models_types_and_event_set()
|
|
179
|
+
)
|
|
180
|
+
ModelType.__setattr__ = ModelType._immutable # type: ignore[method-assign, assignment]
|
|
167
181
|
|
|
168
182
|
|
|
169
183
|
@enum.unique
|
|
@@ -15,11 +15,11 @@ 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=apIXKZHL6dbyXTT4C4lkyo4M-Nf_DwsVXoXBL5jcXVo,37574
|
|
18
|
-
uiprotect/data/bootstrap.py,sha256=
|
|
18
|
+
uiprotect/data/bootstrap.py,sha256=864mLxum0BmC3lIeKqHTs_Z5ikeJIDaRs4ukaVOilWw,21372
|
|
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
|
|
22
|
-
uiprotect/data/types.py,sha256
|
|
22
|
+
uiprotect/data/types.py,sha256=8z8jIoMlfDre7Op1JAN45PLZdAE-4i3gDPSo2uymqu4,17996
|
|
23
23
|
uiprotect/data/user.py,sha256=Wb-ZWSwIJbyUbfVuENtUYbuW-uftHNDcoMH85dvEjkw,7071
|
|
24
24
|
uiprotect/data/websocket.py,sha256=WZJVA7EfYuKYMv-9jmvGgMWXKzE9ES25SKv1NQ2eHjc,6281
|
|
25
25
|
uiprotect/exceptions.py,sha256=kgn0cRM6lTtgLza09SDa3ZiX6ue1QqHCOogQ4qu6KTQ,965
|
|
@@ -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.9.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
|
|
34
|
+
uiprotect-1.9.0.dist-info/METADATA,sha256=XaM24hta0s3qHiy9AdwqBBSqN9civ3yV8yLZcRynksQ,10984
|
|
35
|
+
uiprotect-1.9.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
36
|
+
uiprotect-1.9.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
|
|
37
|
+
uiprotect-1.9.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|