uiprotect 1.11.1__py3-none-any.whl → 1.12.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.

@@ -56,6 +56,7 @@ _LOGGER = logging.getLogger(__name__)
56
56
  MAX_SUPPORTED_CAMERAS = 256
57
57
  MAX_EVENT_HISTORY_IN_STATE_MACHINE = MAX_SUPPORTED_CAMERAS * 2
58
58
  STATS_KEYS = {
59
+ "eventStats",
59
60
  "storageStats",
60
61
  "stats",
61
62
  "systemInfo",
@@ -394,8 +395,7 @@ class Bootstrap(ProtectBaseObject):
394
395
 
395
396
  device_id: str = packet.action_frame.data["id"]
396
397
  self.id_lookup.pop(device_id, None)
397
- device = devices.pop(device_id, None)
398
- if device is None:
398
+ if (device := devices.pop(device_id, None)) is None:
399
399
  return None
400
400
  self.mac_lookup.pop(normalize_mac(device.mac), None)
401
401
 
@@ -486,19 +486,17 @@ class Bootstrap(ProtectBaseObject):
486
486
  elif model_type is ModelType.CAMERA:
487
487
  if TYPE_CHECKING:
488
488
  assert isinstance(obj, Camera)
489
- if "last_ring" in data and obj.last_ring:
490
- is_recent = obj.last_ring + RECENT_EVENT_MAX >= utc_now()
491
- _LOGGER.debug("last_ring for %s (%s)", obj.id, is_recent)
492
- if is_recent:
489
+ if "last_ring" in data and (last_ring := obj.last_ring):
490
+ if is_recent := last_ring + RECENT_EVENT_MAX >= utc_now():
493
491
  obj.set_ring_timeout()
492
+ _LOGGER.debug("last_ring for %s (%s)", obj.id, is_recent)
494
493
  elif model_type is ModelType.SENSOR:
495
494
  if TYPE_CHECKING:
496
495
  assert isinstance(obj, Sensor)
497
- if "alarm_triggered_at" in data and obj.alarm_triggered_at:
498
- is_recent = obj.alarm_triggered_at + RECENT_EVENT_MAX >= utc_now()
499
- _LOGGER.debug("alarm_triggered_at for %s (%s)", obj.id, is_recent)
500
- if is_recent:
496
+ if "alarm_triggered_at" in data and (trigged_at := obj.alarm_triggered_at):
497
+ if is_recent := trigged_at + RECENT_EVENT_MAX >= utc_now():
501
498
  obj.set_alarm_timeout()
499
+ _LOGGER.debug("alarm_triggered_at for %s (%s)", obj.id, is_recent)
502
500
 
503
501
  devices[action_id] = obj
504
502
  self._create_stat(packet, data, False)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uiprotect
3
- Version: 1.11.1
3
+ Version: 1.12.0
4
4
  Summary: Python API for Unifi Protect (Unofficial)
5
5
  Home-page: https://github.com/uilibs/uiprotect
6
6
  License: MIT
@@ -15,7 +15,7 @@ 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
17
  uiprotect/data/base.py,sha256=apIXKZHL6dbyXTT4C4lkyo4M-Nf_DwsVXoXBL5jcXVo,37574
18
- uiprotect/data/bootstrap.py,sha256=gDoYacz_WOIOSegGoL-kuw3WQdRcDWUYPd1BL8oBZJ8,21515
18
+ uiprotect/data/bootstrap.py,sha256=pAb-JC_AatYPldfefiMqdZ3_6Ftngcmd2asAMw66XLE,21486
19
19
  uiprotect/data/convert.py,sha256=8h6Il_DhMkPRDPj9F_rA2UZIlTuchS3BQD24peKpk2A,2185
20
20
  uiprotect/data/devices.py,sha256=Nq3bOko5PFf5LvEBoD4JV8kmbq50laRdh3VHMWX7t-0,111809
21
21
  uiprotect/data/nvr.py,sha256=XC4NO1c_Mom-hIpzj9ksKFcgKbHd6ToqWjkgzxJ1PJY,47636
@@ -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=IzDPyqbzrkOMREvahN-e2zdvVD0VABSCWy6jSoCwOT0,7299
33
- uiprotect-1.11.1.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
34
- uiprotect-1.11.1.dist-info/METADATA,sha256=fkeec2n5_8G4aBG4D3zqBu4FJM7Nle4ATE14_bm6neo,10985
35
- uiprotect-1.11.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
- uiprotect-1.11.1.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
37
- uiprotect-1.11.1.dist-info/RECORD,,
33
+ uiprotect-1.12.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
34
+ uiprotect-1.12.0.dist-info/METADATA,sha256=wPRYZLr1EpqqtUnuenaK3Z-iEdmDqA4YnHCvJG5NQAY,10985
35
+ uiprotect-1.12.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
+ uiprotect-1.12.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
37
+ uiprotect-1.12.0.dist-info/RECORD,,