uiprotect 7.14.1__tar.gz → 7.14.2__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 (38) hide show
  1. {uiprotect-7.14.1 → uiprotect-7.14.2}/PKG-INFO +3 -1
  2. {uiprotect-7.14.1 → uiprotect-7.14.2}/README.md +2 -0
  3. {uiprotect-7.14.1 → uiprotect-7.14.2}/pyproject.toml +1 -1
  4. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/api.py +1 -15
  5. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/__init__.py +2 -21
  6. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/data/bootstrap.py +2 -2
  7. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/data/nvr.py +3 -25
  8. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/utils.py +0 -2
  9. {uiprotect-7.14.1 → uiprotect-7.14.2}/LICENSE +0 -0
  10. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/__init__.py +0 -0
  11. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/__main__.py +0 -0
  12. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/_compat.py +0 -0
  13. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/aiports.py +0 -0
  14. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/backup.py +0 -0
  15. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/base.py +0 -0
  16. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/cameras.py +0 -0
  17. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/chimes.py +0 -0
  18. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/doorlocks.py +0 -0
  19. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/events.py +0 -0
  20. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/lights.py +0 -0
  21. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/liveviews.py +0 -0
  22. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/nvr.py +0 -0
  23. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/sensors.py +0 -0
  24. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/cli/viewers.py +0 -0
  25. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/data/__init__.py +0 -0
  26. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/data/base.py +0 -0
  27. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/data/convert.py +0 -0
  28. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/data/devices.py +0 -0
  29. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/data/types.py +0 -0
  30. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/data/user.py +0 -0
  31. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/data/websocket.py +0 -0
  32. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/exceptions.py +0 -0
  33. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/py.typed +0 -0
  34. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/release_cache.json +0 -0
  35. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/stream.py +0 -0
  36. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/test_util/__init__.py +0 -0
  37. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/test_util/anonymize.py +0 -0
  38. {uiprotect-7.14.1 → uiprotect-7.14.2}/src/uiprotect/websocket.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: uiprotect
3
- Version: 7.14.1
3
+ Version: 7.14.2
4
4
  Summary: Python API for Unifi Protect (Unofficial)
5
5
  License: MIT
6
6
  Author: UI Protect Maintainers
@@ -241,6 +241,8 @@ unsub()
241
241
 
242
242
  ## TODO / Planned / Not Implemented
243
243
 
244
+ Switching from Protect Private API to the New Public API
245
+
244
246
  Generally any feature missing from the library is planned to be done eventually / nice to have with the following exceptions
245
247
 
246
248
  ### UniFi OS Features
@@ -198,6 +198,8 @@ unsub()
198
198
 
199
199
  ## TODO / Planned / Not Implemented
200
200
 
201
+ Switching from Protect Private API to the New Public API
202
+
201
203
  Generally any feature missing from the library is planned to be done eventually / nice to have with the following exceptions
202
204
 
203
205
  ### UniFi OS Features
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "uiprotect"
3
- version = "7.14.1"
3
+ version = "7.14.2"
4
4
  license = "MIT"
5
5
  description = "Python API for Unifi Protect (Unofficial)"
6
6
  authors = [{ name = "UI Protect Maintainers", email = "ui@koston.org" }]
@@ -82,10 +82,7 @@ TOKEN_COOKIE_MAX_EXP_SECONDS = 60
82
82
  DEVICE_UPDATE_INTERVAL = 900
83
83
  # retry timeout for thumbnails/heatmaps
84
84
  RETRY_TIMEOUT = 10
85
- PROTECT_APT_URLS = [
86
- "https://apt.artifacts.ui.com/dists/stretch/release/binary-arm64/Packages",
87
- "https://apt.artifacts.ui.com/dists/bullseye/release/binary-arm64/Packages",
88
- ]
85
+
89
86
  TYPES_BUG_MESSAGE = """There is currently a bug in UniFi Protect that makes `start` / `end` not work if `types` is not provided. This means uiprotect has to iterate over all of the events matching the filters provided to return values.
90
87
 
91
88
  If your Protect instance has a lot of events, this request will take much longer then expected. It is recommended adding additional filters to speed the request up."""
@@ -1915,17 +1912,6 @@ class ProtectApiClient(BaseApiClient):
1915
1912
 
1916
1913
  return versions
1917
1914
 
1918
- async def get_release_versions(self) -> set[Version]:
1919
- """Get all release versions for UniFi Protect"""
1920
- versions: set[Version] = set()
1921
- for url in PROTECT_APT_URLS:
1922
- try:
1923
- versions |= await self._get_versions_from_api(url)
1924
- except NvrError:
1925
- _LOGGER.warning("Failed to retrieve release versions from online.")
1926
-
1927
- return versions
1928
-
1929
1915
  async def relative_move_ptz_camera(
1930
1916
  self,
1931
1917
  device_id: str,
@@ -13,9 +13,9 @@ from rich.progress import track
13
13
 
14
14
  from uiprotect.api import MetaInfo, ProtectApiClient
15
15
 
16
- from ..data import Version, WSPacket
16
+ from ..data import WSPacket
17
17
  from ..test_util import SampleDataGenerator
18
- from ..utils import RELEASE_CACHE, get_local_timezone, run_async
18
+ from ..utils import get_local_timezone, run_async
19
19
  from ..utils import profile_ws as profile_ws_job
20
20
  from .aiports import app as aiports_app
21
21
  from .base import CliContext, OutputFormatEnum
@@ -314,25 +314,6 @@ def decode_ws_msg(
314
314
  typer.echo(orjson.dumps(response).decode("utf-8"))
315
315
 
316
316
 
317
- @app.command()
318
- def release_versions(ctx: typer.Context) -> None:
319
- """Updates the release version cache on disk."""
320
- protect = cast(ProtectApiClient, ctx.obj.protect)
321
-
322
- async def callback() -> set[Version]:
323
- versions = await protect.get_release_versions()
324
- await protect.close_session()
325
- return versions
326
-
327
- _setup_logger()
328
-
329
- versions = run_async(callback())
330
- output = orjson.dumps(sorted([str(v) for v in versions]))
331
-
332
- Path(RELEASE_CACHE).write_bytes(output)
333
- typer.echo(output.decode("utf-8"))
334
-
335
-
336
317
  @app.command()
337
318
  def create_api_key(
338
319
  ctx: typer.Context,
@@ -680,5 +680,5 @@ class Bootstrap(ProtectBaseObject):
680
680
  _LOGGER.debug("Successfully refresh model: %s %s", model_type, device_id)
681
681
 
682
682
  async def get_is_prerelease(self) -> bool:
683
- """Get if current version of Protect is a prerelease version."""
684
- return await self.nvr.get_is_prerelease()
683
+ """[DEPRECATED] Always returns False. Will be removed after HA 2025.8.0."""
684
+ return False
@@ -15,12 +15,11 @@ from uuid import UUID
15
15
 
16
16
  import aiofiles
17
17
  import orjson
18
- from aiofiles import os as aos
19
18
  from convertertools import pop_dict_set_if_none, pop_dict_tuple
20
19
  from pydantic.fields import PrivateAttr
21
20
 
22
21
  from ..exceptions import BadRequest, NotAuthorized
23
- from ..utils import RELEASE_CACHE, convert_to_datetime
22
+ from ..utils import convert_to_datetime
24
23
  from .base import (
25
24
  ProtectBaseObject,
26
25
  ProtectDeviceModel,
@@ -1217,29 +1216,8 @@ class NVR(ProtectDeviceModel):
1217
1216
  return versions
1218
1217
 
1219
1218
  async def get_is_prerelease(self) -> bool:
1220
- """Get if current version of Protect is a prerelease version."""
1221
- # only EA versions have `-beta` in versions
1222
- if self.version.is_prerelease:
1223
- return True
1224
-
1225
- # 2.6.14 is an EA version that looks like a release version
1226
- cache_file_path = self._api.cache_dir / "release_cache.json"
1227
- versions = await self._read_cache_file(
1228
- cache_file_path,
1229
- ) or await self._read_cache_file(RELEASE_CACHE)
1230
- if versions is None or self.version not in versions:
1231
- versions = await self._api.get_release_versions()
1232
- try:
1233
- _LOGGER.debug("Fetching releases from APT repos...")
1234
- tmp = self._api.cache_dir / "release_cache.tmp.json"
1235
- await aos.makedirs(self._api.cache_dir, exist_ok=True)
1236
- async with aiofiles.open(tmp, "wb") as cache_file:
1237
- await cache_file.write(orjson.dumps([str(v) for v in versions]))
1238
- await aos.rename(tmp, cache_file_path)
1239
- except Exception:
1240
- _LOGGER.warning("Failed write cache file.")
1241
-
1242
- return self.version not in versions
1219
+ """[DEPRECATED] Always returns False. Will be removed after HA 2025.8.0."""
1220
+ return False
1243
1221
 
1244
1222
  async def set_smart_detections(self, value: bool) -> None:
1245
1223
  """Set if smart detections are enabled."""
@@ -74,8 +74,6 @@ SNAKE_CASE_MATCH_3 = re.compile("([a-z0-9])([A-Z])")
74
74
 
75
75
  _LOGGER = logging.getLogger(__name__)
76
76
 
77
- RELEASE_CACHE = Path(__file__).parent / "release_cache.json"
78
-
79
77
  _CREATE_TYPES = {IPv6Address, IPv4Address, UUID, Color, Decimal, Path, Version}
80
78
  _BAD_UUID = "00000000-0000-00 0- 000-000000000000"
81
79
 
File without changes