uiprotect 7.5.0__py3-none-any.whl → 7.5.2__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.
uiprotect/data/devices.py CHANGED
@@ -248,7 +248,7 @@ class CameraChannel(ProtectBaseObject):
248
248
  rtsp_alias: str | None = None # read only
249
249
  width: int
250
250
  height: int
251
- fps: int
251
+ fps: int | None = None # read only
252
252
  bitrate: int
253
253
  min_bitrate: int | None = None # read only
254
254
  max_bitrate: int | None = None # read only
@@ -296,7 +296,7 @@ class CameraChannel(ProtectBaseObject):
296
296
 
297
297
  @property
298
298
  def is_package(self) -> bool:
299
- return self.fps <= 2
299
+ return self.fps is not None and self.fps <= 2
300
300
 
301
301
 
302
302
  class ISPSettings(ProtectBaseObject):
@@ -587,19 +587,22 @@ class VideoStats(ProtectBaseObject):
587
587
  @classmethod
588
588
  @cache
589
589
  def unifi_dict_conversions(cls) -> dict[str, object | Callable[[Any], Any]]:
590
- return {
591
- key: convert_to_datetime
592
- for key in (
593
- "recordingStart",
594
- "recordingEnd",
595
- "recordingStartLQ",
596
- "recordingEndLQ",
597
- "timelapseStart",
598
- "timelapseEnd",
599
- "timelapseStartLQ",
600
- "timelapseEndLQ",
590
+ return (
591
+ dict.fromkeys(
592
+ (
593
+ "recordingStart",
594
+ "recordingEnd",
595
+ "recordingStartLQ",
596
+ "recordingEndLQ",
597
+ "timelapseStart",
598
+ "timelapseEnd",
599
+ "timelapseStartLQ",
600
+ "timelapseEndLQ",
601
+ ),
602
+ convert_to_datetime,
601
603
  )
602
- } | super().unifi_dict_conversions()
604
+ | super().unifi_dict_conversions()
605
+ )
603
606
 
604
607
 
605
608
  class StorageStats(ProtectBaseObject):
uiprotect/data/nvr.py CHANGED
@@ -321,10 +321,12 @@ class Event(ProtectModelWithId):
321
321
  @classmethod
322
322
  @cache
323
323
  def unifi_dict_conversions(cls) -> dict[str, object | Callable[[Any], Any]]:
324
- return {
325
- key: convert_to_datetime
326
- for key in ("start", "end", "timestamp", "deletedAt")
327
- } | super().unifi_dict_conversions()
324
+ return (
325
+ dict.fromkeys(
326
+ ("start", "end", "timestamp", "deletedAt"), convert_to_datetime
327
+ )
328
+ | super().unifi_dict_conversions()
329
+ )
328
330
 
329
331
  def unifi_dict(
330
332
  self,
uiprotect/data/types.py CHANGED
@@ -679,7 +679,7 @@ RepeatTimes = Annotated[int, Field(ge=1, le=6)]
679
679
  class PTZPositionDegree(BaseModel):
680
680
  pan: float
681
681
  tilt: float
682
- zoom: int
682
+ zoom: float
683
683
 
684
684
 
685
685
  class PTZPositionSteps(BaseModel):
uiprotect/utils.py CHANGED
@@ -154,7 +154,7 @@ def to_ms(duration: timedelta | None) -> int | None:
154
154
  if duration is None:
155
155
  return None
156
156
 
157
- return int(round(duration.total_seconds() * 1000))
157
+ return round(duration.total_seconds() * 1000)
158
158
 
159
159
 
160
160
  def utc_now() -> datetime:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: uiprotect
3
- Version: 7.5.0
3
+ Version: 7.5.2
4
4
  Summary: Python API for Unifi Protect (Unofficial)
5
5
  Author: UI Protect Maintainers
6
6
  Author-email: ui@koston.org
@@ -19,9 +19,9 @@ uiprotect/data/__init__.py,sha256=audwJBjxRiYdNPeYlP6iofFIOq3gyQzh6VpDsOCM2dQ,29
19
19
  uiprotect/data/base.py,sha256=rXm08mA4W7VErgsjS_lqM9HBhFK5-he1L2N6zFMl5yY,35481
20
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=7CimsFO-Jq-PUQpwA-UOW-XzTslIlLQwvnHb4bc22g8,114256
23
- uiprotect/data/nvr.py,sha256=E18DgE0nXl9VZ_ULotTPcXSi3M1u3mWQsuZbY1gIajs,47490
24
- uiprotect/data/types.py,sha256=XVNVCqyWJGTAo557sWD8yZ-kr_Z_35IpkUr-IuBjpO4,19218
22
+ uiprotect/data/devices.py,sha256=AuQK0vfs5J370TW7GDa6M8ylhaFZoxlAL-_SGyCOAUk,114391
23
+ uiprotect/data/nvr.py,sha256=fu6bWx2NpsUKhPUg7bZHshAnONp41zOL8tc39lypW4c,47520
24
+ uiprotect/data/types.py,sha256=TDZwSKELUN0smXLB8uQkyNsHlB61j2ByijeblEt2Css,19220
25
25
  uiprotect/data/user.py,sha256=Del5LUmt5uCfAQMI9-kl_GaKm085oTLjxmcCrlEKXxc,10526
26
26
  uiprotect/data/websocket.py,sha256=m4EV1Qfh08eKOihy70ycViYgEQpeNSGZQJWdtGIYJDA,6791
27
27
  uiprotect/exceptions.py,sha256=kgn0cRM6lTtgLza09SDa3ZiX6ue1QqHCOogQ4qu6KTQ,965
@@ -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=p2cnc6G_-MNAXpKxy95Mz0CwwZOMvB6Sat1X626n-gg,20564
33
+ uiprotect/utils.py,sha256=5Z30chqnQhQdtD1vabRtZXjBpeiJagL5KDuALQlWxk8,20559
34
34
  uiprotect/websocket.py,sha256=tEyenqblNXHcjWYuf4oRP1E7buNwx6zoECMwpBr-jig,8191
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,,
35
+ uiprotect-7.5.2.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
36
+ uiprotect-7.5.2.dist-info/METADATA,sha256=ZCmDSknaWeoGOM0GWjiX0T7ge_DL2137w-wB0-TQ-Zs,11095
37
+ uiprotect-7.5.2.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
38
+ uiprotect-7.5.2.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
39
+ uiprotect-7.5.2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.0.1
2
+ Generator: poetry-core 2.1.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any