uiprotect 7.4.0__py3-none-any.whl → 7.5.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/base.py CHANGED
@@ -721,9 +721,9 @@ class ProtectModelWithId(ProtectModel):
721
721
  updated,
722
722
  )
723
723
 
724
- assert (
725
- self._update_sync.lock.locked()
726
- ), "save_device_changes should only be called when the update lock is held"
724
+ assert self._update_sync.lock.locked(), (
725
+ "save_device_changes should only be called when the update lock is held"
726
+ )
727
727
  read_only_fields = self.__class__._get_read_only_fields()
728
728
 
729
729
  if self.model is None:
@@ -218,6 +218,12 @@ class Bootstrap(ProtectBaseObject):
218
218
  for model_type in ModelType.bootstrap_models_types_set:
219
219
  key = model_type.devices_key # type: ignore[attr-defined]
220
220
  items: dict[str, ProtectModel] = {}
221
+ if key not in data:
222
+ data[key] = {}
223
+ _LOGGER.error(
224
+ f"Missing key in bootstrap: {key}. This may be fixed by updating Protect."
225
+ )
226
+ continue
221
227
  for item in data[key]:
222
228
  if (
223
229
  api is not None
uiprotect/data/devices.py CHANGED
@@ -250,8 +250,8 @@ class CameraChannel(ProtectBaseObject):
250
250
  height: int
251
251
  fps: int
252
252
  bitrate: int
253
- min_bitrate: int # read only
254
- max_bitrate: int # read only
253
+ min_bitrate: int | None = None # read only
254
+ max_bitrate: int | None = None # read only
255
255
  min_client_adaptive_bit_rate: int | None = None # read only
256
256
  min_motion_adaptive_bit_rate: int | None = None # read only
257
257
  fps_values: list[int] # read only
@@ -390,6 +390,8 @@ class RecordingSettings(ProtectBaseObject):
390
390
  retention_duration: datetime | None = None
391
391
  smart_detect_post_padding: timedelta | None = None
392
392
  smart_detect_pre_padding: timedelta | None = None
393
+ # requires 5.2.39+
394
+ create_access_event: bool | None = None
393
395
 
394
396
  @classmethod
395
397
  @cache
@@ -543,7 +545,7 @@ class LCDMessage(ProtectBaseObject):
543
545
  class TalkbackSettings(ProtectBaseObject):
544
546
  type_fmt: AudioCodecs
545
547
  type_in: str
546
- bind_addr: IPv4Address
548
+ bind_addr: IPv4Address | None = None
547
549
  bind_port: int
548
550
  filter_addr: str | None = None # can be used to restrict sender address
549
551
  filter_port: int | None = None # can be used to restrict sender port
@@ -945,7 +947,7 @@ class Camera(ProtectMotionDeviceModel):
945
947
  feature_flags: CameraFeatureFlags
946
948
  lcd_message: LCDMessage | None = None
947
949
  lenses: list[CameraLenses]
948
- platform: str
950
+ platform: str | None = None
949
951
  has_speaker: bool
950
952
  has_wifi: bool
951
953
  audio_bitrate: int
@@ -978,6 +980,8 @@ class Camera(ProtectMotionDeviceModel):
978
980
  is_third_party_camera: bool | None = None
979
981
  # requires 5.1.78+
980
982
  is_paired_with_ai_port: bool | None = None
983
+ # requires 5.2.39+
984
+ is_adopted_by_access_app: bool | None = None
981
985
  # TODO: used for adopting
982
986
  # apMac read only
983
987
  # apRssi read only
uiprotect/utils.py CHANGED
@@ -241,6 +241,8 @@ def convert_unifi_data(value: Any, field: FieldInfo) -> Any:
241
241
  # 00000000-0000-00 0- 000-000000000000
242
242
  if type_ is UUID and value == _BAD_UUID:
243
243
  return _EMPTY_UUID
244
+ if (type_ is IPv4Address) and value == "":
245
+ return None
244
246
  return type_(value)
245
247
  if _is_enum_type(type_):
246
248
  if _is_from_string_enum(type_):
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: uiprotect
3
- Version: 7.4.0
3
+ Version: 7.5.0
4
4
  Summary: Python API for Unifi Protect (Unofficial)
5
- Home-page: https://github.com/uilibs/uiprotect
6
5
  Author: UI Protect Maintainers
7
6
  Author-email: ui@koston.org
8
7
  Requires-Python: >=3.10
@@ -16,10 +16,10 @@ uiprotect/cli/nvr.py,sha256=TwxEg2XT8jXAbOqv6gc7KFXELKadeItEDYweSL4_-e8,4260
16
16
  uiprotect/cli/sensors.py,sha256=fQtcDJCVxs4VbAqcavgBy2ABiVxAW3GXtna6_XFBp2k,8153
17
17
  uiprotect/cli/viewers.py,sha256=2cyrp104ffIvgT0wYGIO0G35QMkEbFe7fSVqLwDXQYQ,2171
18
18
  uiprotect/data/__init__.py,sha256=audwJBjxRiYdNPeYlP6iofFIOq3gyQzh6VpDsOCM2dQ,2964
19
- uiprotect/data/base.py,sha256=LRqmK60PKeDFgP2k5qpVj93AxEvdfC6kLk0Cqvt1W5k,35481
20
- uiprotect/data/bootstrap.py,sha256=Umija3z2SI4RPJmbzZNolm3jw-GSP4a2d9Fd0xcmf9c,23338
19
+ uiprotect/data/base.py,sha256=rXm08mA4W7VErgsjS_lqM9HBhFK5-he1L2N6zFMl5yY,35481
20
+ uiprotect/data/bootstrap.py,sha256=ddNaKrTprN7Zq0ZE3O_F5whepUh6z9GqyrUWxLyZ0HE,23570
21
21
  uiprotect/data/convert.py,sha256=xEN878_hm0HZZCVYGwJSxcSp2as9zpkvsemVIibReOA,2628
22
- uiprotect/data/devices.py,sha256=ls-paEN3RITVASL0Nezfevpt5ROvxnhbBGYg8dPfAyM,114061
22
+ uiprotect/data/devices.py,sha256=7CimsFO-Jq-PUQpwA-UOW-XzTslIlLQwvnHb4bc22g8,114256
23
23
  uiprotect/data/nvr.py,sha256=E18DgE0nXl9VZ_ULotTPcXSi3M1u3mWQsuZbY1gIajs,47490
24
24
  uiprotect/data/types.py,sha256=XVNVCqyWJGTAo557sWD8yZ-kr_Z_35IpkUr-IuBjpO4,19218
25
25
  uiprotect/data/user.py,sha256=Del5LUmt5uCfAQMI9-kl_GaKm085oTLjxmcCrlEKXxc,10526
@@ -30,10 +30,10 @@ uiprotect/release_cache.json,sha256=NamnSFy78hOWY0DPO87J9ELFCAN6NnVquv8gQO75ZG4,
30
30
  uiprotect/stream.py,sha256=MWiTRFIhUfFLPA_csSrKl5-SkUbPZ2VhDu0XW2oVr-U,4800
31
31
  uiprotect/test_util/__init__.py,sha256=HlQBgIgdtrvT-gQ5OWP92LbgVr_YzsD5NFImLRonUZk,19320
32
32
  uiprotect/test_util/anonymize.py,sha256=f-8ijU-_y9r-uAbhIPn0f0I6hzJpAkvJzc8UpWihObI,8478
33
- uiprotect/utils.py,sha256=q2YYQfxr0b3QEWMSP7SdpcJZbB4huEhpo8PbtnTbEFI,20481
33
+ uiprotect/utils.py,sha256=p2cnc6G_-MNAXpKxy95Mz0CwwZOMvB6Sat1X626n-gg,20564
34
34
  uiprotect/websocket.py,sha256=tEyenqblNXHcjWYuf4oRP1E7buNwx6zoECMwpBr-jig,8191
35
- uiprotect-7.4.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
36
- uiprotect-7.4.0.dist-info/METADATA,sha256=PG-R5cmBiEALyW0c3QNWi0QJ5G4rTer79i4CuIvSNkE,11142
37
- uiprotect-7.4.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
38
- uiprotect-7.4.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
39
- uiprotect-7.4.0.dist-info/RECORD,,
35
+ uiprotect-7.5.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
36
+ uiprotect-7.5.0.dist-info/METADATA,sha256=cD3gf13XfjwmiR-2PDX5PGQHPej66nc78pe1yUBW0zE,11095
37
+ uiprotect-7.5.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
38
+ uiprotect-7.5.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
39
+ uiprotect-7.5.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: poetry-core 2.0.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any