uiprotect 7.16.0__py3-none-any.whl → 7.18.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/api.py +8 -3
- uiprotect/cli/__init__.py +4 -4
- uiprotect/cli/aiports.py +1 -2
- uiprotect/cli/backup.py +4 -4
- uiprotect/cli/base.py +3 -3
- uiprotect/cli/cameras.py +12 -12
- uiprotect/cli/chimes.py +5 -6
- uiprotect/cli/doorlocks.py +2 -3
- uiprotect/cli/events.py +7 -8
- uiprotect/cli/lights.py +2 -3
- uiprotect/cli/liveviews.py +1 -2
- uiprotect/cli/sensors.py +2 -3
- uiprotect/cli/viewers.py +2 -3
- uiprotect/data/devices.py +11 -2
- uiprotect/data/types.py +2 -2
- uiprotect/websocket.py +2 -2
- {uiprotect-7.16.0.dist-info → uiprotect-7.18.0.dist-info}/METADATA +1 -1
- uiprotect-7.18.0.dist-info/RECORD +39 -0
- uiprotect-7.16.0.dist-info/RECORD +0 -39
- {uiprotect-7.16.0.dist-info → uiprotect-7.18.0.dist-info}/LICENSE +0 -0
- {uiprotect-7.16.0.dist-info → uiprotect-7.18.0.dist-info}/WHEEL +0 -0
- {uiprotect-7.16.0.dist-info → uiprotect-7.18.0.dist-info}/entry_points.txt +0 -0
uiprotect/api.py
CHANGED
|
@@ -1519,12 +1519,17 @@ class ProtectApiClient(BaseApiClient):
|
|
|
1519
1519
|
raise_exception=False,
|
|
1520
1520
|
)
|
|
1521
1521
|
|
|
1522
|
-
async def get_public_api_camera_snapshot(
|
|
1522
|
+
async def get_public_api_camera_snapshot(
|
|
1523
|
+
self,
|
|
1524
|
+
camera_id: str,
|
|
1525
|
+
high_quality: bool = False,
|
|
1526
|
+
) -> bytes | None:
|
|
1523
1527
|
"""Gets snapshot for a camera using public api."""
|
|
1524
1528
|
return await self.api_request_raw(
|
|
1525
1529
|
public_api=True,
|
|
1526
|
-
|
|
1527
|
-
|
|
1530
|
+
raise_exception=False,
|
|
1531
|
+
url=f"/v1/cameras/{camera_id}/snapshot",
|
|
1532
|
+
params={"highQuality": high_quality},
|
|
1528
1533
|
)
|
|
1529
1534
|
|
|
1530
1535
|
async def get_package_camera_snapshot(
|
uiprotect/cli/__init__.py
CHANGED
|
@@ -5,7 +5,7 @@ import base64
|
|
|
5
5
|
import logging
|
|
6
6
|
import sys
|
|
7
7
|
from pathlib import Path
|
|
8
|
-
from typing import
|
|
8
|
+
from typing import cast
|
|
9
9
|
|
|
10
10
|
import orjson
|
|
11
11
|
import typer
|
|
@@ -234,7 +234,7 @@ def generate_sample_data(
|
|
|
234
234
|
ctx: typer.Context,
|
|
235
235
|
anonymize: bool = OPTION_ANON,
|
|
236
236
|
wait_time: int = OPTION_WAIT,
|
|
237
|
-
output_folder:
|
|
237
|
+
output_folder: Path | None = OPTION_OUTPUT,
|
|
238
238
|
do_zip: bool = OPTION_ZIP,
|
|
239
239
|
) -> None:
|
|
240
240
|
"""Generates sample data for UniFi Protect instance."""
|
|
@@ -270,7 +270,7 @@ def generate_sample_data(
|
|
|
270
270
|
def profile_ws(
|
|
271
271
|
ctx: typer.Context,
|
|
272
272
|
wait_time: int = OPTION_WAIT,
|
|
273
|
-
output_path:
|
|
273
|
+
output_path: Path | None = OPTION_OUTPUT,
|
|
274
274
|
) -> None:
|
|
275
275
|
"""Profiles Websocket messages for UniFi Protect instance."""
|
|
276
276
|
protect = cast(ProtectApiClient, ctx.obj.protect)
|
|
@@ -297,7 +297,7 @@ def profile_ws(
|
|
|
297
297
|
@app.command()
|
|
298
298
|
def decode_ws_msg(
|
|
299
299
|
ws_file: typer.FileBinaryRead = OPTION_WS_FILE,
|
|
300
|
-
ws_data:
|
|
300
|
+
ws_data: str | None = ARG_WS_DATA,
|
|
301
301
|
) -> None:
|
|
302
302
|
"""Decodes a base64 encoded UniFi Protect Websocket binary message."""
|
|
303
303
|
if ws_file is None and ws_data is None: # type: ignore[unreachable]
|
uiprotect/cli/aiports.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
|
-
from typing import Optional
|
|
5
4
|
|
|
6
5
|
import typer
|
|
7
6
|
|
|
@@ -26,7 +25,7 @@ ALL_COMMANDS, DEVICE_COMMANDS = base.init_common_commands(app)
|
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
@app.callback(invoke_without_command=True)
|
|
29
|
-
def main(ctx: typer.Context, device_id:
|
|
28
|
+
def main(ctx: typer.Context, device_id: str | None = ARG_DEVICE_ID) -> None:
|
|
30
29
|
"""
|
|
31
30
|
AiPort device CLI.
|
|
32
31
|
|
uiprotect/cli/backup.py
CHANGED
|
@@ -10,7 +10,7 @@ from dataclasses import dataclass
|
|
|
10
10
|
from datetime import datetime, timedelta, timezone
|
|
11
11
|
from enum import Enum
|
|
12
12
|
from pathlib import Path
|
|
13
|
-
from typing import TYPE_CHECKING, Any,
|
|
13
|
+
from typing import TYPE_CHECKING, Any, cast
|
|
14
14
|
|
|
15
15
|
import aiofiles
|
|
16
16
|
import aiofiles.os as aos
|
|
@@ -396,9 +396,9 @@ def _setup_logger(verbose: bool) -> None:
|
|
|
396
396
|
@app.callback()
|
|
397
397
|
def main(
|
|
398
398
|
ctx: typer.Context,
|
|
399
|
-
start:
|
|
400
|
-
end:
|
|
401
|
-
output_folder:
|
|
399
|
+
start: str | None = OPTION_START,
|
|
400
|
+
end: str | None = OPTION_END,
|
|
401
|
+
output_folder: Path | None = OPTION_OUTPUT,
|
|
402
402
|
thumbnail_format: str = OPTION_THUMBNAIL_FORMAT,
|
|
403
403
|
gif_format: str = OPTION_GIF_FORMAT,
|
|
404
404
|
event_format: str = OPTION_EVENT_FORMAT,
|
uiprotect/cli/base.py
CHANGED
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
from collections.abc import Callable, Coroutine, Mapping, Sequence
|
|
4
4
|
from dataclasses import dataclass
|
|
5
5
|
from enum import Enum
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, TypeVar
|
|
7
7
|
|
|
8
8
|
import orjson
|
|
9
9
|
import typer
|
|
@@ -166,7 +166,7 @@ def set_ssh(ctx: typer.Context, enabled: bool) -> None:
|
|
|
166
166
|
run(ctx, obj.set_ssh(enabled))
|
|
167
167
|
|
|
168
168
|
|
|
169
|
-
def set_name(ctx: typer.Context, name:
|
|
169
|
+
def set_name(ctx: typer.Context, name: str | None = typer.Argument(None)) -> None:
|
|
170
170
|
"""Sets name for the device"""
|
|
171
171
|
require_device_id(ctx)
|
|
172
172
|
obj: NVR | ProtectAdoptableDeviceModel = ctx.obj.device
|
|
@@ -204,7 +204,7 @@ def unadopt(ctx: typer.Context, force: bool = OPTION_FORCE) -> None:
|
|
|
204
204
|
run(ctx, obj.unadopt())
|
|
205
205
|
|
|
206
206
|
|
|
207
|
-
def adopt(ctx: typer.Context, name:
|
|
207
|
+
def adopt(ctx: typer.Context, name: str | None = typer.Argument(None)) -> None:
|
|
208
208
|
"""
|
|
209
209
|
Adopts a device.
|
|
210
210
|
|
uiprotect/cli/cameras.py
CHANGED
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from datetime import datetime, timezone
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import
|
|
6
|
+
from typing import cast
|
|
7
7
|
|
|
8
8
|
import typer
|
|
9
9
|
from rich.progress import Progress
|
|
@@ -27,7 +27,7 @@ ALL_COMMANDS, DEVICE_COMMANDS = base.init_common_commands(app)
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
@app.callback(invoke_without_command=True)
|
|
30
|
-
def main(ctx: typer.Context, device_id:
|
|
30
|
+
def main(ctx: typer.Context, device_id: str | None = ARG_DEVICE_ID) -> None:
|
|
31
31
|
"""
|
|
32
32
|
Camera device CLI.
|
|
33
33
|
|
|
@@ -74,7 +74,7 @@ def timelapse_url(ctx: typer.Context) -> None:
|
|
|
74
74
|
@app.command()
|
|
75
75
|
def privacy_mode(
|
|
76
76
|
ctx: typer.Context,
|
|
77
|
-
enabled:
|
|
77
|
+
enabled: bool | None = typer.Argument(None),
|
|
78
78
|
) -> None:
|
|
79
79
|
"""
|
|
80
80
|
Returns/sets library managed privacy mode.
|
|
@@ -91,7 +91,7 @@ def privacy_mode(
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
@app.command()
|
|
94
|
-
def chime_type(ctx: typer.Context, value:
|
|
94
|
+
def chime_type(ctx: typer.Context, value: d.ChimeType | None = None) -> None:
|
|
95
95
|
"""Returns/sets the current chime type if the camera has a chime."""
|
|
96
96
|
base.require_device_id(ctx)
|
|
97
97
|
obj: d.Camera = ctx.obj.device
|
|
@@ -137,9 +137,9 @@ def stream_urls(ctx: typer.Context) -> None:
|
|
|
137
137
|
def save_snapshot(
|
|
138
138
|
ctx: typer.Context,
|
|
139
139
|
output_path: Path = typer.Argument(..., help="JPEG format"),
|
|
140
|
-
width:
|
|
141
|
-
height:
|
|
142
|
-
dt:
|
|
140
|
+
width: int | None = typer.Option(None, "-w", "--width"),
|
|
141
|
+
height: int | None = typer.Option(None, "-h", "--height"),
|
|
142
|
+
dt: datetime | None = typer.Option(None, "-t", "--timestamp"),
|
|
143
143
|
package: bool = typer.Option(False, "-p", "--package", help="Get package camera"),
|
|
144
144
|
) -> None:
|
|
145
145
|
"""
|
|
@@ -188,7 +188,7 @@ def save_video(
|
|
|
188
188
|
max=3,
|
|
189
189
|
help="0 = High, 1 = Medium, 2 = Low, 3 = Package",
|
|
190
190
|
),
|
|
191
|
-
fps:
|
|
191
|
+
fps: int | None = typer.Option(
|
|
192
192
|
None,
|
|
193
193
|
"--fps",
|
|
194
194
|
min=1,
|
|
@@ -245,7 +245,7 @@ def save_video(
|
|
|
245
245
|
def play_audio(
|
|
246
246
|
ctx: typer.Context,
|
|
247
247
|
url: str = typer.Argument(..., help="ffmpeg playable URL"),
|
|
248
|
-
ffmpeg_path:
|
|
248
|
+
ffmpeg_path: Path | None = typer.Option(
|
|
249
249
|
None,
|
|
250
250
|
"--ffmpeg-path",
|
|
251
251
|
help="Path to ffmpeg executable",
|
|
@@ -542,15 +542,15 @@ def set_osd_bitrate(ctx: typer.Context, enabled: bool) -> None:
|
|
|
542
542
|
@app.command()
|
|
543
543
|
def set_lcd_text(
|
|
544
544
|
ctx: typer.Context,
|
|
545
|
-
text_type:
|
|
545
|
+
text_type: d.DoorbellMessageType | None = typer.Argument(
|
|
546
546
|
None,
|
|
547
547
|
help="No value sets it back to the global default doorbell message.",
|
|
548
548
|
),
|
|
549
|
-
text:
|
|
549
|
+
text: str | None = typer.Argument(
|
|
550
550
|
None,
|
|
551
551
|
help="Only for CUSTOM_MESSAGE text type",
|
|
552
552
|
),
|
|
553
|
-
reset_at:
|
|
553
|
+
reset_at: datetime | None = typer.Option(
|
|
554
554
|
None,
|
|
555
555
|
"-r",
|
|
556
556
|
"--reset-time",
|
uiprotect/cli/chimes.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
|
-
from typing import Optional
|
|
5
4
|
|
|
6
5
|
import typer
|
|
7
6
|
|
|
@@ -26,7 +25,7 @@ ALL_COMMANDS, DEVICE_COMMANDS = base.init_common_commands(app)
|
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
@app.callback(invoke_without_command=True)
|
|
29
|
-
def main(ctx: typer.Context, device_id:
|
|
28
|
+
def main(ctx: typer.Context, device_id: str | None = ARG_DEVICE_ID) -> None:
|
|
30
29
|
"""
|
|
31
30
|
Chime device CLI.
|
|
32
31
|
|
|
@@ -114,7 +113,7 @@ def cameras(
|
|
|
114
113
|
def set_volume(
|
|
115
114
|
ctx: typer.Context,
|
|
116
115
|
value: int = ARG_VOLUME,
|
|
117
|
-
camera_id:
|
|
116
|
+
camera_id: str | None = typer.Option(
|
|
118
117
|
None,
|
|
119
118
|
"-c",
|
|
120
119
|
"--camera",
|
|
@@ -138,8 +137,8 @@ def set_volume(
|
|
|
138
137
|
@app.command()
|
|
139
138
|
def play(
|
|
140
139
|
ctx: typer.Context,
|
|
141
|
-
volume:
|
|
142
|
-
repeat_times:
|
|
140
|
+
volume: int | None = typer.Option(None, "-v", "--volume", min=1, max=100),
|
|
141
|
+
repeat_times: int | None = typer.Option(None, "-r", "--repeat", min=1, max=6),
|
|
143
142
|
) -> None:
|
|
144
143
|
"""Plays chime tone."""
|
|
145
144
|
base.require_device_id(ctx)
|
|
@@ -159,7 +158,7 @@ def play_buzzer(ctx: typer.Context) -> None:
|
|
|
159
158
|
def set_repeat_times(
|
|
160
159
|
ctx: typer.Context,
|
|
161
160
|
value: int = ARG_REPEAT,
|
|
162
|
-
camera_id:
|
|
161
|
+
camera_id: str | None = typer.Option(
|
|
163
162
|
None,
|
|
164
163
|
"-c",
|
|
165
164
|
"--camera",
|
uiprotect/cli/doorlocks.py
CHANGED
|
@@ -2,7 +2,6 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from datetime import timedelta
|
|
5
|
-
from typing import Optional
|
|
6
5
|
|
|
7
6
|
import typer
|
|
8
7
|
|
|
@@ -25,7 +24,7 @@ ALL_COMMANDS, DEVICE_COMMANDS = base.init_common_commands(app)
|
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
@app.callback(invoke_without_command=True)
|
|
28
|
-
def main(ctx: typer.Context, device_id:
|
|
27
|
+
def main(ctx: typer.Context, device_id: str | None = ARG_DEVICE_ID) -> None:
|
|
29
28
|
"""
|
|
30
29
|
Doorlock device CLI.
|
|
31
30
|
|
|
@@ -59,7 +58,7 @@ def main(ctx: typer.Context, device_id: Optional[str] = ARG_DEVICE_ID) -> None:
|
|
|
59
58
|
|
|
60
59
|
|
|
61
60
|
@app.command()
|
|
62
|
-
def camera(ctx: typer.Context, camera_id:
|
|
61
|
+
def camera(ctx: typer.Context, camera_id: str | None = typer.Argument(None)) -> None:
|
|
63
62
|
"""Returns or sets tha paired camera for a doorlock."""
|
|
64
63
|
base.require_device_id(ctx)
|
|
65
64
|
obj: Doorlock = ctx.obj.device
|
uiprotect/cli/events.py
CHANGED
|
@@ -4,7 +4,6 @@ from collections.abc import Callable
|
|
|
4
4
|
from dataclasses import dataclass
|
|
5
5
|
from datetime import datetime
|
|
6
6
|
from pathlib import Path
|
|
7
|
-
from typing import Optional
|
|
8
7
|
|
|
9
8
|
import typer
|
|
10
9
|
from rich.progress import Progress
|
|
@@ -43,13 +42,13 @@ ALL_COMMANDS: dict[str, Callable[..., None]] = {}
|
|
|
43
42
|
@app.callback(invoke_without_command=True)
|
|
44
43
|
def main(
|
|
45
44
|
ctx: typer.Context,
|
|
46
|
-
event_id:
|
|
47
|
-
start:
|
|
48
|
-
end:
|
|
49
|
-
limit:
|
|
50
|
-
offset:
|
|
51
|
-
types:
|
|
52
|
-
smart_types:
|
|
45
|
+
event_id: str | None = ARG_EVENT_ID,
|
|
46
|
+
start: datetime | None = OPTION_START,
|
|
47
|
+
end: datetime | None = OPTION_END,
|
|
48
|
+
limit: int | None = OPTION_LIMIT,
|
|
49
|
+
offset: int | None = OPTION_OFFSET,
|
|
50
|
+
types: list[d.EventType] | None = OPTION_TYPES,
|
|
51
|
+
smart_types: list[d.SmartDetectObjectType] | None = OPTION_SMART_TYPES,
|
|
53
52
|
) -> None:
|
|
54
53
|
"""
|
|
55
54
|
Events CLI.
|
uiprotect/cli/lights.py
CHANGED
|
@@ -2,7 +2,6 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from datetime import timedelta
|
|
5
|
-
from typing import Optional
|
|
6
5
|
|
|
7
6
|
import typer
|
|
8
7
|
|
|
@@ -25,7 +24,7 @@ ALL_COMMANDS, DEVICE_COMMANDS = base.init_common_commands(app)
|
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
@app.callback(invoke_without_command=True)
|
|
28
|
-
def main(ctx: typer.Context, device_id:
|
|
27
|
+
def main(ctx: typer.Context, device_id: str | None = ARG_DEVICE_ID) -> None:
|
|
29
28
|
"""
|
|
30
29
|
Lights device CLI.
|
|
31
30
|
|
|
@@ -59,7 +58,7 @@ def main(ctx: typer.Context, device_id: Optional[str] = ARG_DEVICE_ID) -> None:
|
|
|
59
58
|
|
|
60
59
|
|
|
61
60
|
@app.command()
|
|
62
|
-
def camera(ctx: typer.Context, camera_id:
|
|
61
|
+
def camera(ctx: typer.Context, camera_id: str | None = typer.Argument(None)) -> None:
|
|
63
62
|
"""Returns or sets tha paired camera for a light."""
|
|
64
63
|
base.require_device_id(ctx)
|
|
65
64
|
obj: Light = ctx.obj.device
|
uiprotect/cli/liveviews.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
|
-
from typing import Optional
|
|
5
4
|
|
|
6
5
|
import typer
|
|
7
6
|
|
|
@@ -24,7 +23,7 @@ class LiveviewContext(base.CliContext):
|
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
@app.callback(invoke_without_command=True)
|
|
27
|
-
def main(ctx: typer.Context, device_id:
|
|
26
|
+
def main(ctx: typer.Context, device_id: str | None = ARG_DEVICE_ID) -> None:
|
|
28
27
|
"""
|
|
29
28
|
Liveviews CLI.
|
|
30
29
|
|
uiprotect/cli/sensors.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
|
-
from typing import Optional
|
|
5
4
|
|
|
6
5
|
import typer
|
|
7
6
|
|
|
@@ -24,7 +23,7 @@ ALL_COMMANDS, DEVICE_COMMANDS = base.init_common_commands(app)
|
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
@app.callback(invoke_without_command=True)
|
|
27
|
-
def main(ctx: typer.Context, device_id:
|
|
26
|
+
def main(ctx: typer.Context, device_id: str | None = ARG_DEVICE_ID) -> None:
|
|
28
27
|
"""
|
|
29
28
|
Sensors device CLI.
|
|
30
29
|
|
|
@@ -58,7 +57,7 @@ def main(ctx: typer.Context, device_id: Optional[str] = ARG_DEVICE_ID) -> None:
|
|
|
58
57
|
|
|
59
58
|
|
|
60
59
|
@app.command()
|
|
61
|
-
def camera(ctx: typer.Context, camera_id:
|
|
60
|
+
def camera(ctx: typer.Context, camera_id: str | None = typer.Argument(None)) -> None:
|
|
62
61
|
"""Returns or sets tha paired camera for a sensor."""
|
|
63
62
|
base.require_device_id(ctx)
|
|
64
63
|
obj: Sensor = ctx.obj.device
|
uiprotect/cli/viewers.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
|
-
from typing import Optional
|
|
5
4
|
|
|
6
5
|
import typer
|
|
7
6
|
|
|
@@ -24,7 +23,7 @@ ALL_COMMANDS, DEVICE_COMMANDS = base.init_common_commands(app)
|
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
@app.callback(invoke_without_command=True)
|
|
27
|
-
def main(ctx: typer.Context, device_id:
|
|
26
|
+
def main(ctx: typer.Context, device_id: str | None = ARG_DEVICE_ID) -> None:
|
|
28
27
|
"""
|
|
29
28
|
Viewers device CLI.
|
|
30
29
|
|
|
@@ -60,7 +59,7 @@ def main(ctx: typer.Context, device_id: Optional[str] = ARG_DEVICE_ID) -> None:
|
|
|
60
59
|
@app.command()
|
|
61
60
|
def liveview(
|
|
62
61
|
ctx: typer.Context,
|
|
63
|
-
liveview_id:
|
|
62
|
+
liveview_id: str | None = typer.Argument(None),
|
|
64
63
|
) -> None:
|
|
65
64
|
"""Returns or sets the current liveview."""
|
|
66
65
|
base.require_device_id(ctx)
|
uiprotect/data/devices.py
CHANGED
|
@@ -864,6 +864,8 @@ class CameraFeatureFlags(ProtectBaseObject):
|
|
|
864
864
|
# 4.73.71+
|
|
865
865
|
support_nfc: bool | None = None
|
|
866
866
|
has_fingerprint_sensor: bool | None = None
|
|
867
|
+
# 6.0.0+
|
|
868
|
+
support_full_hd_snapshot: bool | None = None
|
|
867
869
|
|
|
868
870
|
focus: PTZRange
|
|
869
871
|
pan: PTZRange
|
|
@@ -2085,12 +2087,19 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
2085
2087
|
|
|
2086
2088
|
return await self._api.get_camera_snapshot(self.id, width, height, dt=dt)
|
|
2087
2089
|
|
|
2088
|
-
async def get_public_api_snapshot(
|
|
2090
|
+
async def get_public_api_snapshot(
|
|
2091
|
+
self, high_quality: bool | None = None
|
|
2092
|
+
) -> bytes | None:
|
|
2089
2093
|
"""Gets snapshot for camera using public API."""
|
|
2090
2094
|
if self._api._api_key is None:
|
|
2091
2095
|
raise NotAuthorized("Cannot get public API snapshot without an API key.")
|
|
2092
2096
|
|
|
2093
|
-
|
|
2097
|
+
if high_quality is None:
|
|
2098
|
+
high_quality = self.feature_flags.support_full_hd_snapshot or False
|
|
2099
|
+
|
|
2100
|
+
return await self._api.get_public_api_camera_snapshot(
|
|
2101
|
+
camera_id=self.id, high_quality=high_quality
|
|
2102
|
+
)
|
|
2094
2103
|
|
|
2095
2104
|
async def get_package_snapshot(
|
|
2096
2105
|
self,
|
uiprotect/data/types.py
CHANGED
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import enum
|
|
4
4
|
from collections.abc import Callable, Coroutine
|
|
5
5
|
from functools import cache, lru_cache
|
|
6
|
-
from typing import Annotated, Any, Literal,
|
|
6
|
+
from typing import Annotated, Any, Literal, TypeVar, Union
|
|
7
7
|
|
|
8
8
|
from packaging.version import Version as BaseVersion
|
|
9
9
|
from pydantic import BaseModel, Field
|
|
@@ -50,7 +50,7 @@ EventCategories = Literal[
|
|
|
50
50
|
]
|
|
51
51
|
|
|
52
52
|
ProgressCallback = Callable[[int, int, int], Coroutine[Any, Any, None]]
|
|
53
|
-
IteratorCallback = Callable[[int,
|
|
53
|
+
IteratorCallback = Callable[[int, bytes | None], Coroutine[Any, Any, None]]
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
class FixSizeOrderedDict(dict[KT, VT]):
|
uiprotect/websocket.py
CHANGED
|
@@ -8,7 +8,7 @@ import logging
|
|
|
8
8
|
from collections.abc import Awaitable, Callable, Coroutine
|
|
9
9
|
from enum import Enum
|
|
10
10
|
from http import HTTPStatus
|
|
11
|
-
from typing import Any
|
|
11
|
+
from typing import Any
|
|
12
12
|
|
|
13
13
|
import aiohttp
|
|
14
14
|
from aiohttp import (
|
|
@@ -24,7 +24,7 @@ from yarl import URL
|
|
|
24
24
|
from .exceptions import NotAuthorized, NvrError
|
|
25
25
|
|
|
26
26
|
_LOGGER = logging.getLogger(__name__)
|
|
27
|
-
AuthCallbackType = Callable[..., Coroutine[Any, Any,
|
|
27
|
+
AuthCallbackType = Callable[..., Coroutine[Any, Any, dict[str, str] | None]]
|
|
28
28
|
GetSessionCallbackType = Callable[[], Awaitable[ClientSession]]
|
|
29
29
|
UpdateBootstrapCallbackType = Callable[[], None]
|
|
30
30
|
_CLOSE_MESSAGE_TYPES = {WSMsgType.CLOSE, WSMsgType.CLOSING, WSMsgType.CLOSED}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
uiprotect/__init__.py,sha256=Oz6i1tonIz4QWVnEPkbielJDJ3WQdwZVgYtjY4IwGAQ,636
|
|
2
|
+
uiprotect/__main__.py,sha256=C_bHCOkv5qj6WMy-6ELoY3Y6HDhLxOa1a30CzmbZhsg,462
|
|
3
|
+
uiprotect/_compat.py,sha256=HThmb1zQZCEssCxYYbQzFhJq8zYYlVaSnIEZabKc-6U,302
|
|
4
|
+
uiprotect/api.py,sha256=GPCgimBo8Sz-4njUhPWhe5uEZ0ZdXKuZ8xlKOwdN9vk,73812
|
|
5
|
+
uiprotect/cli/__init__.py,sha256=J5KE7Wt_rIr55EdGxfTOCoGfBzO5gzO5WvaruXp5AZI,9688
|
|
6
|
+
uiprotect/cli/aiports.py,sha256=22sC-OVkUFfBGJR2oID8QzWsk4GQfLEmam06-LBP2Z0,1545
|
|
7
|
+
uiprotect/cli/backup.py,sha256=lC44FujSYgVBUs32CbsY8pBejO4qScy6U94UzO-l2fc,36742
|
|
8
|
+
uiprotect/cli/base.py,sha256=FojWPuLHlZ3kpn7WZTQjCbWwweWtP-xDpmtT88xAcds,7565
|
|
9
|
+
uiprotect/cli/cameras.py,sha256=YAQoL1-bUspXIxnXoqA81yBSvOroURUt20aPl0aZjBI,16930
|
|
10
|
+
uiprotect/cli/chimes.py,sha256=5-ARR0hVsmg8EvtCQMllCvIsHHjB81hfVdgG8Y6ZEOw,5283
|
|
11
|
+
uiprotect/cli/doorlocks.py,sha256=zoRYE0IsnEI0x7t8aBj08GFZeDNnDGe5IrUFpP6Mxqk,3489
|
|
12
|
+
uiprotect/cli/events.py,sha256=x2a9-18Bt-SPqz1xwNH4CjKAtvbIrpeOiUwSQj065BA,7137
|
|
13
|
+
uiprotect/cli/lights.py,sha256=U7K-YHg2nnsfZfcpjJr5RB0UUVbd3Vn5nlDIA6ng6yo,3530
|
|
14
|
+
uiprotect/cli/liveviews.py,sha256=wJLJh33UVqSOB6UpQhR3tO--CXxGTtJz_WBhPLZLPkc,1832
|
|
15
|
+
uiprotect/cli/nvr.py,sha256=TwxEg2XT8jXAbOqv6gc7KFXELKadeItEDYweSL4_-e8,4260
|
|
16
|
+
uiprotect/cli/sensors.py,sha256=crz_R52X7EFKQtBgL2QzacThExOOoN5NubERQuw5jpk,8119
|
|
17
|
+
uiprotect/cli/viewers.py,sha256=IgJpOzwdo9HVs55Osf3uC5d0raeU19WFIW-RfrnnOug,2137
|
|
18
|
+
uiprotect/data/__init__.py,sha256=audwJBjxRiYdNPeYlP6iofFIOq3gyQzh6VpDsOCM2dQ,2964
|
|
19
|
+
uiprotect/data/base.py,sha256=CXIxaJCJNpavadn6uF7vlhI4wxkfD8MNBGgR-smRA7k,35401
|
|
20
|
+
uiprotect/data/bootstrap.py,sha256=r0T1qD6ZFC86pWK-70kx5MxugrN31XqVxUQ6BfB78O4,23552
|
|
21
|
+
uiprotect/data/convert.py,sha256=xEN878_hm0HZZCVYGwJSxcSp2as9zpkvsemVIibReOA,2628
|
|
22
|
+
uiprotect/data/devices.py,sha256=vnJcnBUMvyjvo8Y9IIwH5p3VTtwhTGFB-CzMk5-044I,116438
|
|
23
|
+
uiprotect/data/nvr.py,sha256=HnknmMmUxe1aPA0PHJZSiEwpvo1phtHBp3wXsU6v_iI,46681
|
|
24
|
+
uiprotect/data/types.py,sha256=RhVqW9mteksrjYMlUqm8YKaVNq5Xc_ksg6-ipSwiR-4,19300
|
|
25
|
+
uiprotect/data/user.py,sha256=Del5LUmt5uCfAQMI9-kl_GaKm085oTLjxmcCrlEKXxc,10526
|
|
26
|
+
uiprotect/data/websocket.py,sha256=m4EV1Qfh08eKOihy70ycViYgEQpeNSGZQJWdtGIYJDA,6791
|
|
27
|
+
uiprotect/exceptions.py,sha256=kgn0cRM6lTtgLza09SDa3ZiX6ue1QqHCOogQ4qu6KTQ,965
|
|
28
|
+
uiprotect/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
+
uiprotect/release_cache.json,sha256=NamnSFy78hOWY0DPO87J9ELFCAN6NnVquv8gQO75ZG4,386
|
|
30
|
+
uiprotect/stream.py,sha256=ls65vMOXF4IlJ5axewFITfhcaTh_ihaFeCkCTfhy0Nk,5168
|
|
31
|
+
uiprotect/test_util/__init__.py,sha256=O22HGFX5Mb0j9LPzO48tm4ZqZTqGVBHo0jnye2FdT_I,19803
|
|
32
|
+
uiprotect/test_util/anonymize.py,sha256=f-8ijU-_y9r-uAbhIPn0f0I6hzJpAkvJzc8UpWihObI,8478
|
|
33
|
+
uiprotect/utils.py,sha256=2fLwXN0oz9dcVTFexzLp8jj97lcYrxLZkeEUGf5ehtU,20587
|
|
34
|
+
uiprotect/websocket.py,sha256=ww-PberFztJppRQMKwdu5A9gyofepV-Y6am4Hj_DV44,8178
|
|
35
|
+
uiprotect-7.18.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
|
|
36
|
+
uiprotect-7.18.0.dist-info/METADATA,sha256=Fmu8ppuTcuiGR83DCE5iQkFufCwTx5Eh1WWYKi_s9Xc,11167
|
|
37
|
+
uiprotect-7.18.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
38
|
+
uiprotect-7.18.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
|
|
39
|
+
uiprotect-7.18.0.dist-info/RECORD,,
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
uiprotect/__init__.py,sha256=Oz6i1tonIz4QWVnEPkbielJDJ3WQdwZVgYtjY4IwGAQ,636
|
|
2
|
-
uiprotect/__main__.py,sha256=C_bHCOkv5qj6WMy-6ELoY3Y6HDhLxOa1a30CzmbZhsg,462
|
|
3
|
-
uiprotect/_compat.py,sha256=HThmb1zQZCEssCxYYbQzFhJq8zYYlVaSnIEZabKc-6U,302
|
|
4
|
-
uiprotect/api.py,sha256=7eg1CoTV9sgnUcm9WnusXon3ltWOA_SuCbTxfmNY68Y,73711
|
|
5
|
-
uiprotect/cli/__init__.py,sha256=rVfmLd4Al4-FQZxq7QrYlfr46fBGZv6Aw5huFtmCn58,9707
|
|
6
|
-
uiprotect/cli/aiports.py,sha256=wpEr2w_hY18CGpFiQM2Yc0FiVwG_1l2CzZhZLGNigvI,1576
|
|
7
|
-
uiprotect/cli/backup.py,sha256=9Coo5K4YTvQIrvGVZ-NYUajGnoMIyPhK_juxQxNkdO0,36761
|
|
8
|
-
uiprotect/cli/base.py,sha256=SFwgIeliu1_l07IGMerSNPPKvV2g3-Amoc9YiCGmaVA,7581
|
|
9
|
-
uiprotect/cli/cameras.py,sha256=YvvMccQEYG3Wih0Ix8tan1R1vfaJ6cogg6YKWLzMUV8,16973
|
|
10
|
-
uiprotect/cli/chimes.py,sha256=XANn21bQVkestkKOm9HjxSM8ZGrRrqvUXLouaQ3LTqs,5326
|
|
11
|
-
uiprotect/cli/doorlocks.py,sha256=Go_Tn68bAcmrRAnUIi4kBiR7ciKQsu_R150ubPTjUAs,3523
|
|
12
|
-
uiprotect/cli/events.py,sha256=D5SRejKzsPpKlZ9O2J4wkJRigFRVEymiLyU8VQ43fqI,7186
|
|
13
|
-
uiprotect/cli/lights.py,sha256=Eoc6H6fyguxqi5P1x3CjLUmhkyi-zYdBj-mxmTVJJyY,3564
|
|
14
|
-
uiprotect/cli/liveviews.py,sha256=GU5z-ZLRBXHyspDKiJpiv-kbaBcvxK_-K70rPoqx2Ms,1863
|
|
15
|
-
uiprotect/cli/nvr.py,sha256=TwxEg2XT8jXAbOqv6gc7KFXELKadeItEDYweSL4_-e8,4260
|
|
16
|
-
uiprotect/cli/sensors.py,sha256=fQtcDJCVxs4VbAqcavgBy2ABiVxAW3GXtna6_XFBp2k,8153
|
|
17
|
-
uiprotect/cli/viewers.py,sha256=2cyrp104ffIvgT0wYGIO0G35QMkEbFe7fSVqLwDXQYQ,2171
|
|
18
|
-
uiprotect/data/__init__.py,sha256=audwJBjxRiYdNPeYlP6iofFIOq3gyQzh6VpDsOCM2dQ,2964
|
|
19
|
-
uiprotect/data/base.py,sha256=CXIxaJCJNpavadn6uF7vlhI4wxkfD8MNBGgR-smRA7k,35401
|
|
20
|
-
uiprotect/data/bootstrap.py,sha256=r0T1qD6ZFC86pWK-70kx5MxugrN31XqVxUQ6BfB78O4,23552
|
|
21
|
-
uiprotect/data/convert.py,sha256=xEN878_hm0HZZCVYGwJSxcSp2as9zpkvsemVIibReOA,2628
|
|
22
|
-
uiprotect/data/devices.py,sha256=WIMlVIsX2XafcB1GFwoCocTf5KBagPgNLWWsPtjnM54,116155
|
|
23
|
-
uiprotect/data/nvr.py,sha256=HnknmMmUxe1aPA0PHJZSiEwpvo1phtHBp3wXsU6v_iI,46681
|
|
24
|
-
uiprotect/data/types.py,sha256=PIf08tkkLzLPu8IHlEfv5Jqy7sdyhcbLkBgoV21Kyv0,19313
|
|
25
|
-
uiprotect/data/user.py,sha256=Del5LUmt5uCfAQMI9-kl_GaKm085oTLjxmcCrlEKXxc,10526
|
|
26
|
-
uiprotect/data/websocket.py,sha256=m4EV1Qfh08eKOihy70ycViYgEQpeNSGZQJWdtGIYJDA,6791
|
|
27
|
-
uiprotect/exceptions.py,sha256=kgn0cRM6lTtgLza09SDa3ZiX6ue1QqHCOogQ4qu6KTQ,965
|
|
28
|
-
uiprotect/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
-
uiprotect/release_cache.json,sha256=NamnSFy78hOWY0DPO87J9ELFCAN6NnVquv8gQO75ZG4,386
|
|
30
|
-
uiprotect/stream.py,sha256=ls65vMOXF4IlJ5axewFITfhcaTh_ihaFeCkCTfhy0Nk,5168
|
|
31
|
-
uiprotect/test_util/__init__.py,sha256=O22HGFX5Mb0j9LPzO48tm4ZqZTqGVBHo0jnye2FdT_I,19803
|
|
32
|
-
uiprotect/test_util/anonymize.py,sha256=f-8ijU-_y9r-uAbhIPn0f0I6hzJpAkvJzc8UpWihObI,8478
|
|
33
|
-
uiprotect/utils.py,sha256=2fLwXN0oz9dcVTFexzLp8jj97lcYrxLZkeEUGf5ehtU,20587
|
|
34
|
-
uiprotect/websocket.py,sha256=tEyenqblNXHcjWYuf4oRP1E7buNwx6zoECMwpBr-jig,8191
|
|
35
|
-
uiprotect-7.16.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
|
|
36
|
-
uiprotect-7.16.0.dist-info/METADATA,sha256=nX5HtYYpHiqVVuKo19MPKSOzG163q8prcUWufzaXzYY,11167
|
|
37
|
-
uiprotect-7.16.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
38
|
-
uiprotect-7.16.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
|
|
39
|
-
uiprotect-7.16.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|