uiprotect 0.2.1__tar.gz → 0.3.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.

Files changed (36) hide show
  1. {uiprotect-0.2.1 → uiprotect-0.3.0}/PKG-INFO +9 -5
  2. {uiprotect-0.2.1 → uiprotect-0.3.0}/README.md +8 -4
  3. {uiprotect-0.2.1 → uiprotect-0.3.0}/pyproject.toml +3 -2
  4. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/cli/base.py +1 -1
  5. {uiprotect-0.2.1 → uiprotect-0.3.0}/LICENSE +0 -0
  6. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/__init__.py +0 -0
  7. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/__main__.py +0 -0
  8. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/api.py +0 -0
  9. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/cli/__init__.py +0 -0
  10. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/cli/backup.py +0 -0
  11. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/cli/cameras.py +0 -0
  12. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/cli/chimes.py +0 -0
  13. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/cli/doorlocks.py +0 -0
  14. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/cli/events.py +0 -0
  15. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/cli/lights.py +0 -0
  16. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/cli/liveviews.py +0 -0
  17. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/cli/nvr.py +0 -0
  18. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/cli/sensors.py +0 -0
  19. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/cli/viewers.py +0 -0
  20. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/data/__init__.py +0 -0
  21. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/data/base.py +0 -0
  22. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/data/bootstrap.py +0 -0
  23. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/data/convert.py +0 -0
  24. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/data/devices.py +0 -0
  25. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/data/nvr.py +1 -1
  26. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/data/types.py +0 -0
  27. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/data/user.py +0 -0
  28. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/data/websocket.py +0 -0
  29. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/exceptions.py +0 -0
  30. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/py.typed +0 -0
  31. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/release_cache.json +0 -0
  32. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/stream.py +0 -0
  33. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/test_util/__init__.py +0 -0
  34. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/test_util/anonymize.py +0 -0
  35. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/utils.py +1 -1
  36. {uiprotect-0.2.1 → uiprotect-0.3.0}/src/uiprotect/websocket.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uiprotect
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: Python API for Unifi Protect (Unofficial)
5
5
  Home-page: https://github.com/uilibs/uiprotect
6
6
  License: MIT
@@ -90,6 +90,10 @@ Install this via pip (or your favorite package manager):
90
90
 
91
91
  `pip install uiprotect`
92
92
 
93
+ ## History
94
+
95
+ This project was split off from `pyunifiprotect` because that project changed its license to one that would not be accepted in Home Assistant. This project is committed to keeping the MIT license.
96
+
93
97
  ## Credits
94
98
 
95
99
  - Bjarne Riis ([@briis](https://github.com/briis/)) for the original pyunifiprotect package
@@ -134,7 +138,7 @@ If you want to install `uiprotect` natively, the below are the requirements:
134
138
 
135
139
  - [UniFi Protect](https://ui.com/camera-security) version 1.20+
136
140
  - Latest version of library is generally only tested against the two latest minor version. This is either two latest stable versions (such as 1.21.x and 2.0.x) or the latest EA version and stable version (such as 2.2.x EA and 2.1.x).
137
- - [Python](https://www.python.org/) 3.9+
141
+ - [Python](https://www.python.org/) 3.10+
138
142
  - POSIX compatible system
139
143
  - Library is only test on Linux, specifically the latest Debian version available for the official Python Docker images, but there is no reason the library should not work on any Linux distro or MacOS.
140
144
  - [ffmpeg](https://ffmpeg.org/)
@@ -165,7 +169,7 @@ pip install git+https://github.com/uilibs/uiprotect.git#egg=uiprotect
165
169
  A Docker container is also provided so you do not need to install/manage Python as well. You can add the following to your `.bashrc` or similar.
166
170
 
167
171
  ```bash
168
- function unifi-protect() {
172
+ function uiprotect() {
169
173
  docker run --rm -it \
170
174
  -e UFP_USERNAME=YOUR_USERNAME_HERE \
171
175
  -e UFP_PASSWORD=YOUR_PASSWORD_HERE \
@@ -200,8 +204,8 @@ export UFP_PORT=443
200
204
  # change to false if you do not have a valid HTTPS Certificate for your instance
201
205
  export UFP_SSL_VERIFY=True
202
206
 
203
- unifi-protect --help
204
- unifi-protect nvr
207
+ uiprotect --help
208
+ uiprotect nvr
205
209
  ```
206
210
 
207
211
  ### Python
@@ -50,6 +50,10 @@ Install this via pip (or your favorite package manager):
50
50
 
51
51
  `pip install uiprotect`
52
52
 
53
+ ## History
54
+
55
+ This project was split off from `pyunifiprotect` because that project changed its license to one that would not be accepted in Home Assistant. This project is committed to keeping the MIT license.
56
+
53
57
  ## Credits
54
58
 
55
59
  - Bjarne Riis ([@briis](https://github.com/briis/)) for the original pyunifiprotect package
@@ -94,7 +98,7 @@ If you want to install `uiprotect` natively, the below are the requirements:
94
98
 
95
99
  - [UniFi Protect](https://ui.com/camera-security) version 1.20+
96
100
  - Latest version of library is generally only tested against the two latest minor version. This is either two latest stable versions (such as 1.21.x and 2.0.x) or the latest EA version and stable version (such as 2.2.x EA and 2.1.x).
97
- - [Python](https://www.python.org/) 3.9+
101
+ - [Python](https://www.python.org/) 3.10+
98
102
  - POSIX compatible system
99
103
  - Library is only test on Linux, specifically the latest Debian version available for the official Python Docker images, but there is no reason the library should not work on any Linux distro or MacOS.
100
104
  - [ffmpeg](https://ffmpeg.org/)
@@ -125,7 +129,7 @@ pip install git+https://github.com/uilibs/uiprotect.git#egg=uiprotect
125
129
  A Docker container is also provided so you do not need to install/manage Python as well. You can add the following to your `.bashrc` or similar.
126
130
 
127
131
  ```bash
128
- function unifi-protect() {
132
+ function uiprotect() {
129
133
  docker run --rm -it \
130
134
  -e UFP_USERNAME=YOUR_USERNAME_HERE \
131
135
  -e UFP_PASSWORD=YOUR_PASSWORD_HERE \
@@ -160,8 +164,8 @@ export UFP_PORT=443
160
164
  # change to false if you do not have a valid HTTPS Certificate for your instance
161
165
  export UFP_SSL_VERIFY=True
162
166
 
163
- unifi-protect --help
164
- unifi-protect nvr
167
+ uiprotect --help
168
+ uiprotect nvr
165
169
  ```
166
170
 
167
171
  ### Python
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "uiprotect"
3
- version = "0.2.1"
3
+ version = "0.3.0"
4
4
  description = "Python API for Unifi Protect (Unofficial)"
5
5
  authors = ["UI Protect Maintainers <ui@koston.org>"]
6
6
  license = "MIT"
@@ -110,7 +110,7 @@ exclude_lines = [
110
110
  ]
111
111
 
112
112
  [tool.ruff]
113
- target-version = "py38"
113
+ target-version = "py310"
114
114
  line-length = 88
115
115
 
116
116
  [tool.ruff.lint]
@@ -136,6 +136,7 @@ ignore = [
136
136
  "S110", # `try`-`except`-`pass` detected, consider logging the exception
137
137
  "D106", # Missing docstring in public nested class
138
138
  "UP007", # typer needs Optional syntax
139
+ "UP038", # Use `X | Y` in `isinstance` is slower
139
140
  ]
140
141
  select = [
141
142
  "B", # flake8-bugbear
@@ -208,7 +208,7 @@ def adopt(ctx: typer.Context, name: Optional[str] = typer.Argument(None)) -> Non
208
208
  Adopts a device.
209
209
 
210
210
  By default, unadopted devices do not show up in the bootstrap. Use
211
- `unifi-protect -u` to show unadopted devices.
211
+ `uiprotect -u` to show unadopted devices.
212
212
  """
213
213
  require_device_id(ctx)
214
214
  obj: ProtectAdoptableDeviceModel = ctx.obj.device
File without changes
@@ -4,6 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import asyncio
6
6
  import logging
7
+ import zoneinfo
7
8
  from datetime import datetime, timedelta, tzinfo
8
9
  from functools import cache
9
10
  from ipaddress import IPv4Address, IPv6Address
@@ -13,7 +14,6 @@ from uuid import UUID
13
14
 
14
15
  import aiofiles
15
16
  import orjson
16
- import zoneinfo
17
17
  from aiofiles import os as aos
18
18
  from pydantic.v1.fields import PrivateAttr
19
19
 
@@ -10,6 +10,7 @@ import re
10
10
  import socket
11
11
  import sys
12
12
  import time
13
+ import zoneinfo
13
14
  from collections import Counter
14
15
  from collections.abc import Callable, Coroutine, Iterable
15
16
  from copy import deepcopy
@@ -26,7 +27,6 @@ from typing import TYPE_CHECKING, Any, TypeVar, Union, overload
26
27
  from uuid import UUID
27
28
 
28
29
  import jwt
29
- import zoneinfo
30
30
  from aiohttp import ClientResponse
31
31
  from pydantic.v1.fields import SHAPE_DICT, SHAPE_LIST, SHAPE_SET, ModelField
32
32
  from pydantic.v1.utils import to_camel