uiprotect 5.0.0__py3-none-any.whl → 5.1.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/devices.py CHANGED
@@ -1134,11 +1134,9 @@ class Camera(ProtectMotionDeviceModel):
1134
1134
  smart_type: SmartDetectObjectType,
1135
1135
  ) -> Event | None:
1136
1136
  """Get the last smart detect event for given type."""
1137
- event_id = self.last_smart_detect_event_ids.get(smart_type)
1138
- if event_id is None:
1139
- return None
1140
-
1141
- return self._api.bootstrap.events.get(event_id)
1137
+ if event_id := self.last_smart_detect_event_ids.get(smart_type):
1138
+ return self._api.bootstrap.events.get(event_id)
1139
+ return None
1142
1140
 
1143
1141
  @property
1144
1142
  def last_smart_audio_detect_event(self) -> Event | None:
@@ -1222,19 +1220,20 @@ class Camera(ProtectMotionDeviceModel):
1222
1220
  """Get active smart detection types."""
1223
1221
  if self.use_global:
1224
1222
  return set(self.smart_detect_settings.object_types).intersection(
1225
- self.feature_flags.smart_detect_types,
1223
+ self.feature_flags.smart_detect_types
1226
1224
  )
1227
1225
  return set(self.smart_detect_settings.object_types)
1228
1226
 
1229
1227
  @property
1230
1228
  def active_audio_detect_types(self) -> set[SmartDetectAudioType]:
1231
1229
  """Get active audio detection types."""
1230
+ if not (enabled_audio_types := self.smart_detect_settings.audio_types):
1231
+ return set()
1232
1232
  if self.use_global:
1233
- return set(self.smart_detect_settings.audio_types or []).intersection(
1234
- self.feature_flags.smart_detect_audio_types or [],
1235
- )
1236
-
1237
- return set(self.smart_detect_settings.audio_types or [])
1233
+ if not (feature_audio_types := self.feature_flags.smart_detect_audio_types):
1234
+ return set()
1235
+ return set(feature_audio_types).intersection(enabled_audio_types)
1236
+ return set(enabled_audio_types)
1238
1237
 
1239
1238
  @property
1240
1239
  def is_motion_detection_on(self) -> bool:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uiprotect
3
- Version: 5.0.0
3
+ Version: 5.1.0
4
4
  Summary: Python API for Unifi Protect (Unofficial)
5
5
  Home-page: https://github.com/uilibs/uiprotect
6
6
  Author: UI Protect Maintainers
@@ -17,7 +17,7 @@ uiprotect/data/__init__.py,sha256=OcfuJl2qXfHcj_mdnrHhzZ5tEIZrw8auziX5IE7dn-I,29
17
17
  uiprotect/data/base.py,sha256=J2ytJqWJIsFq7vXYG4gfp2c-mrj5gqa3UhmItF0MWbI,35033
18
18
  uiprotect/data/bootstrap.py,sha256=l1r2eHsjdE6subYAllvdaXOs26-dQDcnrDBxF2fenbI,20500
19
19
  uiprotect/data/convert.py,sha256=8h6Il_DhMkPRDPj9F_rA2UZIlTuchS3BQD24peKpk2A,2185
20
- uiprotect/data/devices.py,sha256=VRehNQHJFefwnAfBwC72QG5tzs5z86uOAfbr9Fu4R2g,109832
20
+ uiprotect/data/devices.py,sha256=GdoDXVkiIvJQExoe8km94cdLkdESJzhsiWquBswBaqA,109917
21
21
  uiprotect/data/nvr.py,sha256=8M-62AG4q1k71eX-DaFcdO52QWG4zO9X5Voj0Tj9D5A,46598
22
22
  uiprotect/data/types.py,sha256=3CocULpkdTgF4is1nIEDYIlwf2EOkNNM7L4kJ7NkAwM,17654
23
23
  uiprotect/data/user.py,sha256=YvgXJKV4_y-bm0eySWz9f_ie9aR5lpVn17t9H0Pix8I,6998
@@ -30,8 +30,8 @@ uiprotect/test_util/__init__.py,sha256=Ky8mTL61nhp5II2mxTKBAsSGvNqK8U_CfKC5AGwTo
30
30
  uiprotect/test_util/anonymize.py,sha256=f-8ijU-_y9r-uAbhIPn0f0I6hzJpAkvJzc8UpWihObI,8478
31
31
  uiprotect/utils.py,sha256=9ny9-GMn5Fpnxaw9i769VTIDp4ntfgiCCItqJYWepns,19769
32
32
  uiprotect/websocket.py,sha256=D5DZrMzo434ecp8toNxOB5HM193kVwYw42yEcg99yMw,8029
33
- uiprotect-5.0.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
34
- uiprotect-5.0.0.dist-info/METADATA,sha256=wE8gx41SJjaYT-w5RA_6a-qZoauXYIxEqFKG1X1Se_4,11009
35
- uiprotect-5.0.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
- uiprotect-5.0.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
37
- uiprotect-5.0.0.dist-info/RECORD,,
33
+ uiprotect-5.1.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
34
+ uiprotect-5.1.0.dist-info/METADATA,sha256=OQVQsAbczGehKhrGAdgPEVikjg7I4hYWNdhRIyE-WJw,11009
35
+ uiprotect-5.1.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
+ uiprotect-5.1.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
37
+ uiprotect-5.1.0.dist-info/RECORD,,