uiprotect 0.8.0__tar.gz → 0.9.0__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-0.8.0 → uiprotect-0.9.0}/PKG-INFO +1 -1
- {uiprotect-0.8.0 → uiprotect-0.9.0}/pyproject.toml +1 -1
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/api.py +5 -2
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/data/bootstrap.py +2 -2
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/data/types.py +20 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/LICENSE +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/README.md +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/__init__.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/__main__.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/cli/__init__.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/cli/backup.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/cli/base.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/cli/cameras.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/cli/chimes.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/cli/doorlocks.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/cli/events.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/cli/lights.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/cli/liveviews.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/cli/nvr.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/cli/sensors.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/cli/viewers.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/data/__init__.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/data/base.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/data/convert.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/data/devices.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/data/nvr.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/data/user.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/data/websocket.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/exceptions.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/py.typed +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/release_cache.json +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/stream.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/test_util/__init__.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/test_util/anonymize.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/utils.py +0 -0
- {uiprotect-0.8.0 → uiprotect-0.9.0}/src/uiprotect/websocket.py +0 -0
|
@@ -1075,7 +1075,10 @@ class ProtectApiClient(BaseApiClient):
|
|
|
1075
1075
|
|
|
1076
1076
|
for event_dict in response:
|
|
1077
1077
|
# ignore unknown events
|
|
1078
|
-
if
|
|
1078
|
+
if (
|
|
1079
|
+
"type" not in event_dict
|
|
1080
|
+
or event_dict["type"] not in EventType.values_set()
|
|
1081
|
+
):
|
|
1079
1082
|
_LOGGER.debug("Unknown event type: %s", event_dict)
|
|
1080
1083
|
continue
|
|
1081
1084
|
|
|
@@ -1086,7 +1089,7 @@ class ProtectApiClient(BaseApiClient):
|
|
|
1086
1089
|
continue
|
|
1087
1090
|
|
|
1088
1091
|
if (
|
|
1089
|
-
event.type.value in EventType.
|
|
1092
|
+
event.type.value in EventType.device_events_set()
|
|
1090
1093
|
and event.score >= self._minimum_score
|
|
1091
1094
|
):
|
|
1092
1095
|
events.append(event)
|
|
@@ -553,7 +553,7 @@ class Bootstrap(ProtectBaseObject):
|
|
|
553
553
|
if action["newUpdateId"] is not None:
|
|
554
554
|
self.last_update_id = action["newUpdateId"]
|
|
555
555
|
|
|
556
|
-
if action["modelKey"] not in ModelType.
|
|
556
|
+
if action["modelKey"] not in ModelType.values_set():
|
|
557
557
|
_LOGGER.debug("Unknown model type: %s", action["modelKey"])
|
|
558
558
|
self._create_stat(packet, [], True)
|
|
559
559
|
return None
|
|
@@ -577,7 +577,7 @@ class Bootstrap(ProtectBaseObject):
|
|
|
577
577
|
if action["modelKey"] == ModelType.NVR.value:
|
|
578
578
|
return self._process_nvr_update(packet, data, ignore_stats)
|
|
579
579
|
if (
|
|
580
|
-
action["modelKey"] in ModelType.
|
|
580
|
+
action["modelKey"] in ModelType.bootstrap_models_set()
|
|
581
581
|
or action["modelKey"] == ModelType.EVENT.value
|
|
582
582
|
):
|
|
583
583
|
return self._process_device_update(
|
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import enum
|
|
4
4
|
from collections.abc import Callable, Coroutine
|
|
5
|
+
from functools import cache
|
|
5
6
|
from typing import Any, Literal, Optional, TypeVar, Union
|
|
6
7
|
|
|
7
8
|
from packaging.version import Version as BaseVersion
|
|
@@ -58,11 +59,17 @@ class ValuesEnumMixin:
|
|
|
58
59
|
_values_normalized: dict[str, str] | None = None
|
|
59
60
|
|
|
60
61
|
@classmethod
|
|
62
|
+
@cache
|
|
61
63
|
def values(cls) -> list[str]:
|
|
62
64
|
if cls._values is None:
|
|
63
65
|
cls._values = [e.value for e in cls] # type: ignore[attr-defined]
|
|
64
66
|
return cls._values
|
|
65
67
|
|
|
68
|
+
@classmethod
|
|
69
|
+
@cache
|
|
70
|
+
def values_set(cls) -> set[str]:
|
|
71
|
+
return set(cls.values())
|
|
72
|
+
|
|
66
73
|
@classmethod
|
|
67
74
|
def _missing_(cls, value: Any) -> Any | None:
|
|
68
75
|
if cls._values_normalized is None:
|
|
@@ -103,6 +110,7 @@ class ModelType(str, UnknownValuesEnumMixin, enum.Enum):
|
|
|
103
110
|
UNKNOWN = "unknown"
|
|
104
111
|
|
|
105
112
|
@staticmethod
|
|
113
|
+
@cache
|
|
106
114
|
def bootstrap_models() -> tuple[str, ...]:
|
|
107
115
|
# TODO:
|
|
108
116
|
# legacyUFV
|
|
@@ -121,6 +129,11 @@ class ModelType(str, UnknownValuesEnumMixin, enum.Enum):
|
|
|
121
129
|
ModelType.CHIME.value,
|
|
122
130
|
)
|
|
123
131
|
|
|
132
|
+
@staticmethod
|
|
133
|
+
@cache
|
|
134
|
+
def bootstrap_models_set() -> set[str]:
|
|
135
|
+
return set(ModelType.bootstrap_models())
|
|
136
|
+
|
|
124
137
|
|
|
125
138
|
@enum.unique
|
|
126
139
|
class EventType(str, ValuesEnumMixin, enum.Enum):
|
|
@@ -204,6 +217,7 @@ class EventType(str, ValuesEnumMixin, enum.Enum):
|
|
|
204
217
|
RECORDING_OFF = "recordingOff"
|
|
205
218
|
|
|
206
219
|
@staticmethod
|
|
220
|
+
@cache
|
|
207
221
|
def device_events() -> list[str]:
|
|
208
222
|
return [
|
|
209
223
|
EventType.MOTION.value,
|
|
@@ -212,6 +226,12 @@ class EventType(str, ValuesEnumMixin, enum.Enum):
|
|
|
212
226
|
]
|
|
213
227
|
|
|
214
228
|
@staticmethod
|
|
229
|
+
@cache
|
|
230
|
+
def device_events_set() -> set[str]:
|
|
231
|
+
return set(EventType.device_events())
|
|
232
|
+
|
|
233
|
+
@staticmethod
|
|
234
|
+
@cache
|
|
215
235
|
def motion_events() -> list[str]:
|
|
216
236
|
return [EventType.MOTION.value, EventType.SMART_DETECT.value]
|
|
217
237
|
|
|
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
|