uiprotect 1.7.1__tar.gz → 1.7.2__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-1.7.1 → uiprotect-1.7.2}/PKG-INFO +1 -1
  2. {uiprotect-1.7.1 → uiprotect-1.7.2}/pyproject.toml +1 -1
  3. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/data/base.py +11 -5
  4. {uiprotect-1.7.1 → uiprotect-1.7.2}/LICENSE +0 -0
  5. {uiprotect-1.7.1 → uiprotect-1.7.2}/README.md +0 -0
  6. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/__init__.py +0 -0
  7. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/__main__.py +0 -0
  8. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/api.py +0 -0
  9. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/cli/__init__.py +0 -0
  10. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/cli/backup.py +0 -0
  11. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/cli/base.py +0 -0
  12. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/cli/cameras.py +0 -0
  13. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/cli/chimes.py +0 -0
  14. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/cli/doorlocks.py +0 -0
  15. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/cli/events.py +0 -0
  16. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/cli/lights.py +0 -0
  17. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/cli/liveviews.py +0 -0
  18. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/cli/nvr.py +0 -0
  19. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/cli/sensors.py +0 -0
  20. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/cli/viewers.py +0 -0
  21. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/data/__init__.py +0 -0
  22. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/data/bootstrap.py +0 -0
  23. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/data/convert.py +0 -0
  24. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/data/devices.py +0 -0
  25. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/data/nvr.py +0 -0
  26. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/data/types.py +0 -0
  27. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/data/user.py +0 -0
  28. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/data/websocket.py +0 -0
  29. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/exceptions.py +0 -0
  30. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/py.typed +0 -0
  31. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/release_cache.json +0 -0
  32. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/stream.py +0 -0
  33. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/test_util/__init__.py +0 -0
  34. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/test_util/anonymize.py +0 -0
  35. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/utils.py +0 -0
  36. {uiprotect-1.7.1 → uiprotect-1.7.2}/src/uiprotect/websocket.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uiprotect
3
- Version: 1.7.1
3
+ Version: 1.7.2
4
4
  Summary: Python API for Unifi Protect (Unofficial)
5
5
  Home-page: https://github.com/uilibs/uiprotect
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "uiprotect"
3
- version = "1.7.1"
3
+ version = "1.7.2"
4
4
  description = "Python API for Unifi Protect (Unofficial)"
5
5
  authors = ["UI Protect Maintainers <ui@koston.org>"]
6
6
  license = "MIT"
@@ -66,6 +66,8 @@ if TYPE_CHECKING:
66
66
  ProtectObject = TypeVar("ProtectObject", bound="ProtectBaseObject")
67
67
  RECENT_EVENT_MAX = timedelta(seconds=30)
68
68
  EVENT_PING_INTERVAL = timedelta(seconds=3)
69
+ EVENT_PING_INTERVAL_SECONDS = EVENT_PING_INTERVAL.total_seconds()
70
+
69
71
  _LOGGER = logging.getLogger(__name__)
70
72
 
71
73
 
@@ -787,10 +789,14 @@ class ProtectModelWithId(ProtectModel):
787
789
  raise
788
790
 
789
791
  if force_emit:
790
- await self.emit_message(updated)
792
+ self._emit_message(updated)
791
793
 
792
794
  async def emit_message(self, updated: dict[str, Any]) -> None:
793
- """Emites fake WS message for ProtectApiClient to process."""
795
+ """Emits fake WS message for ProtectApiClient to process."""
796
+ self._emit_message(updated)
797
+
798
+ def _emit_message(self, updated: dict[str, Any]) -> None:
799
+ """Emits fake WS message for ProtectApiClient to process."""
794
800
  if updated == {}:
795
801
  _LOGGER.debug("Event ping callback started for %s", self.id)
796
802
 
@@ -877,9 +883,9 @@ class ProtectDeviceModel(ProtectModelWithId):
877
883
  _LOGGER.debug("Event ping timer started for %s", self.id)
878
884
  loop = asyncio.get_event_loop()
879
885
  self._callback_ping = loop.call_later(
880
- EVENT_PING_INTERVAL.total_seconds(),
881
- asyncio.create_task,
882
- self.emit_message({}),
886
+ EVENT_PING_INTERVAL_SECONDS,
887
+ self._emit_message,
888
+ {},
883
889
  )
884
890
 
885
891
  async def set_name(self, name: str | None) -> None:
File without changes
File without changes