uiprotect 1.15.0__py3-none-any.whl → 1.16.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
@@ -401,15 +401,12 @@ class ProtectBaseObject(BaseModel):
401
401
  if not isinstance(value, list):
402
402
  return value
403
403
 
404
- items: list[Any] = []
405
- for item in value:
406
- if isinstance(item, ProtectBaseObject):
407
- new_item = item.unifi_dict()
408
- else:
409
- new_item = klass.construct({}).unifi_dict(data=item) # type: ignore[arg-type]
410
- items.append(new_item)
411
-
412
- return items
404
+ return [
405
+ item.unifi_dict()
406
+ if isinstance(item, ProtectBaseObject)
407
+ else klass.construct({}).unifi_dict(data=item) # type: ignore[arg-type]
408
+ for item in value
409
+ ]
413
410
 
414
411
  def _unifi_dict_protect_obj_dict(
415
412
  self,
@@ -424,13 +421,10 @@ class ProtectBaseObject(BaseModel):
424
421
  if not isinstance(value, dict):
425
422
  return value
426
423
 
427
- items: dict[Any, Any] = {}
428
- for obj_key, obj in value.items():
429
- if isinstance(obj, ProtectBaseObject):
430
- obj = obj.unifi_dict()
431
- items[obj_key] = obj
432
-
433
- return items
424
+ return {
425
+ obj_key: obj.unifi_dict() if isinstance(obj, ProtectBaseObject) else obj
426
+ for obj_key, obj in value.items()
427
+ }
434
428
 
435
429
  def unifi_dict(
436
430
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uiprotect
3
- Version: 1.15.0
3
+ Version: 1.16.0
4
4
  Summary: Python API for Unifi Protect (Unofficial)
5
5
  Home-page: https://github.com/uilibs/uiprotect
6
6
  License: MIT
@@ -14,7 +14,7 @@ uiprotect/cli/nvr.py,sha256=TwxEg2XT8jXAbOqv6gc7KFXELKadeItEDYweSL4_-e8,4260
14
14
  uiprotect/cli/sensors.py,sha256=fQtcDJCVxs4VbAqcavgBy2ABiVxAW3GXtna6_XFBp2k,8153
15
15
  uiprotect/cli/viewers.py,sha256=2cyrp104ffIvgT0wYGIO0G35QMkEbFe7fSVqLwDXQYQ,2171
16
16
  uiprotect/data/__init__.py,sha256=OcfuJl2qXfHcj_mdnrHhzZ5tEIZrw8auziX5IE7dn-I,2938
17
- uiprotect/data/base.py,sha256=OWKeMWk7n5VaHF_meTt2Ykw7H9zx6U47u-P2vLNDWzE,36627
17
+ uiprotect/data/base.py,sha256=gsi5nBs6qOsSvexfjQsTSt1DUE3ESm9EHmeHrPGl90w,36461
18
18
  uiprotect/data/bootstrap.py,sha256=copw7uL_YIthNH-PraSoqg5vL-UpGrt95zKy1FpHn5w,21881
19
19
  uiprotect/data/convert.py,sha256=8h6Il_DhMkPRDPj9F_rA2UZIlTuchS3BQD24peKpk2A,2185
20
20
  uiprotect/data/devices.py,sha256=Nq3bOko5PFf5LvEBoD4JV8kmbq50laRdh3VHMWX7t-0,111809
@@ -30,8 +30,8 @@ uiprotect/test_util/__init__.py,sha256=d2g7afa0LSdixQ0kjEDYwafDFME_UlW2LzxpamZ2B
30
30
  uiprotect/test_util/anonymize.py,sha256=f-8ijU-_y9r-uAbhIPn0f0I6hzJpAkvJzc8UpWihObI,8478
31
31
  uiprotect/utils.py,sha256=6OLY8hNiCzk418PjJJIlFW7jjPzVt1vxBKEzBSqMeTk,18418
32
32
  uiprotect/websocket.py,sha256=JHI_2EZeRPqPyQopsBZS0dr3tu0HaTiqeLazfBXhW_8,7339
33
- uiprotect-1.15.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
34
- uiprotect-1.15.0.dist-info/METADATA,sha256=vGRfaDV2IzMD9WNxZ2Z9VDsSEwsegr1hJJET3YvBa5E,10985
35
- uiprotect-1.15.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
- uiprotect-1.15.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
37
- uiprotect-1.15.0.dist-info/RECORD,,
33
+ uiprotect-1.16.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
34
+ uiprotect-1.16.0.dist-info/METADATA,sha256=X_w4MPVwxNcZe3P4CcwOMpfD6TY67sEPZj0FSKJCoxI,10985
35
+ uiprotect-1.16.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
+ uiprotect-1.16.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
37
+ uiprotect-1.16.0.dist-info/RECORD,,