uiprotect 5.0.0__tar.gz → 5.1.0__tar.gz

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.

Files changed (36) hide show
  1. {uiprotect-5.0.0 → uiprotect-5.1.0}/PKG-INFO +1 -1
  2. {uiprotect-5.0.0 → uiprotect-5.1.0}/pyproject.toml +1 -1
  3. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/data/devices.py +10 -11
  4. {uiprotect-5.0.0 → uiprotect-5.1.0}/LICENSE +0 -0
  5. {uiprotect-5.0.0 → uiprotect-5.1.0}/README.md +0 -0
  6. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/__init__.py +0 -0
  7. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/__main__.py +0 -0
  8. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/api.py +0 -0
  9. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/cli/__init__.py +0 -0
  10. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/cli/backup.py +0 -0
  11. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/cli/base.py +0 -0
  12. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/cli/cameras.py +0 -0
  13. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/cli/chimes.py +0 -0
  14. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/cli/doorlocks.py +0 -0
  15. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/cli/events.py +0 -0
  16. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/cli/lights.py +0 -0
  17. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/cli/liveviews.py +0 -0
  18. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/cli/nvr.py +0 -0
  19. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/cli/sensors.py +0 -0
  20. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/cli/viewers.py +0 -0
  21. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/data/__init__.py +0 -0
  22. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/data/base.py +0 -0
  23. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/data/bootstrap.py +0 -0
  24. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/data/convert.py +0 -0
  25. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/data/nvr.py +0 -0
  26. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/data/types.py +0 -0
  27. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/data/user.py +0 -0
  28. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/data/websocket.py +0 -0
  29. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/exceptions.py +0 -0
  30. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/py.typed +0 -0
  31. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/release_cache.json +0 -0
  32. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/stream.py +0 -0
  33. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/test_util/__init__.py +0 -0
  34. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/test_util/anonymize.py +0 -0
  35. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/utils.py +0 -0
  36. {uiprotect-5.0.0 → uiprotect-5.1.0}/src/uiprotect/websocket.py +0 -0
@@ -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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "uiprotect"
3
- version = "5.0.0"
3
+ version = "5.1.0"
4
4
  description = "Python API for Unifi Protect (Unofficial)"
5
5
  authors = ["UI Protect Maintainers <ui@koston.org>"]
6
6
  readme = "README.md"
@@ -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:
File without changes
File without changes