uiprotect 5.4.0__py3-none-any.whl → 6.0.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/api.py CHANGED
@@ -191,6 +191,7 @@ class BaseApiClient:
191
191
  cache_dir: Path | None = None,
192
192
  config_dir: Path | None = None,
193
193
  store_sessions: bool = True,
194
+ ws_receive_timeout: int | None = None,
194
195
  ) -> None:
195
196
  self._auth_lock = asyncio.Lock()
196
197
  self._host = host
@@ -200,6 +201,7 @@ class BaseApiClient:
200
201
  self._password = password
201
202
  self._verify_ssl = verify_ssl
202
203
  self._ws_timeout = ws_timeout
204
+ self._ws_receive_timeout = ws_receive_timeout
203
205
  self._loaded_session = False
204
206
  self._update_task: asyncio.Task[Bootstrap | None] | None = None
205
207
 
@@ -277,6 +279,7 @@ class BaseApiClient:
277
279
  self._on_websocket_state_change,
278
280
  verify=self._verify_ssl,
279
281
  timeout=self._ws_timeout,
282
+ receive_timeout=self._ws_receive_timeout,
280
283
  )
281
284
  return self._websocket
282
285
 
@@ -752,6 +755,7 @@ class ProtectApiClient(BaseApiClient):
752
755
  ignore_stats: bool = False,
753
756
  ignore_unadopted: bool = True,
754
757
  debug: bool = False,
758
+ ws_receive_timeout: int | None = None,
755
759
  ) -> None:
756
760
  super().__init__(
757
761
  host=host,
@@ -761,6 +765,7 @@ class ProtectApiClient(BaseApiClient):
761
765
  verify_ssl=verify_ssl,
762
766
  session=session,
763
767
  ws_timeout=ws_timeout,
768
+ ws_receive_timeout=ws_receive_timeout,
764
769
  cache_dir=cache_dir,
765
770
  config_dir=config_dir,
766
771
  store_sessions=store_sessions,
uiprotect/websocket.py CHANGED
@@ -55,10 +55,12 @@ class Websocket:
55
55
  timeout: float = 30.0,
56
56
  backoff: int = 10,
57
57
  verify: bool = True,
58
+ receive_timeout: float | None = None,
58
59
  ) -> None:
59
60
  """Init Websocket."""
60
61
  self.get_url = get_url
61
62
  self.timeout = timeout
63
+ self.receive_timeout = receive_timeout
62
64
  self.backoff = backoff
63
65
  self.verify = verify
64
66
  self._get_session = get_session
@@ -117,7 +119,7 @@ class Websocket:
117
119
  async def _websocket_inner_loop(self, url: URL) -> None:
118
120
  _LOGGER.debug("Connecting WS to %s", url)
119
121
  await self._attempt_auth(False)
120
- ssl = None if self.verify else False
122
+ ssl = True if self.verify else False
121
123
  msg: WSMessage | None = None
122
124
  self._seen_non_close_message = False
123
125
  session = await self._get_session()
@@ -127,7 +129,7 @@ class Websocket:
127
129
  url, ssl=ssl, headers=self._headers, timeout=self.timeout
128
130
  )
129
131
  while True:
130
- msg = await self._ws_connection.receive(self.timeout)
132
+ msg = await self._ws_connection.receive(self.receive_timeout)
131
133
  msg_type = msg.type
132
134
  if msg_type is WSMsgType.ERROR:
133
135
  _LOGGER.exception("Error from Websocket: %s", msg.data)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uiprotect
3
- Version: 5.4.0
3
+ Version: 6.0.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
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Topic :: Software Development :: Build Tools
19
19
  Classifier: Topic :: Software Development :: Libraries
20
20
  Requires-Dist: aiofiles (>=23)
21
- Requires-Dist: aiohttp (>=3.9.0)
21
+ Requires-Dist: aiohttp (>=3.10.0)
22
22
  Requires-Dist: aioshutil (>=1.3)
23
23
  Requires-Dist: async-timeout (>=3.0.1)
24
24
  Requires-Dist: convertertools (>=0.5.0)
@@ -1,6 +1,6 @@
1
1
  uiprotect/__init__.py,sha256=GDRM9WvWUBbOyBVgltq6Qv8i7LVdWEbG8q5EzYvOFbE,636
2
2
  uiprotect/__main__.py,sha256=C_bHCOkv5qj6WMy-6ELoY3Y6HDhLxOa1a30CzmbZhsg,462
3
- uiprotect/api.py,sha256=1gtyhk-MRFy6_wGR32Y520XJ2Ucxr1nevuBosod0r7w,67637
3
+ uiprotect/api.py,sha256=8kC9v6EM67kfdtPDIW8dlqjZl_s5Lffj4o-Z_dOMmdQ,67894
4
4
  uiprotect/cli/__init__.py,sha256=1MO8rJmjjAsfVx2x01gn5DJo8B64xdPGo6gRVJbWd18,8868
5
5
  uiprotect/cli/backup.py,sha256=ZiS7RZnJGKI8TJKLW2cOUzkRM8nyTvE5Ov_jZZGtvSM,36708
6
6
  uiprotect/cli/base.py,sha256=k-_qGuNT7br0iV0KE5F4wYXF75iyLLjBEckTqxC71xM,7591
@@ -29,9 +29,9 @@ uiprotect/stream.py,sha256=McV3XymKyjn-1uV5jdQHcpaDjqLS4zWyMASQ8ubcyb4,4924
29
29
  uiprotect/test_util/__init__.py,sha256=Ky8mTL61nhp5II2mxTKBAsSGvNqK8U_CfKC5AGwToAI,18704
30
30
  uiprotect/test_util/anonymize.py,sha256=f-8ijU-_y9r-uAbhIPn0f0I6hzJpAkvJzc8UpWihObI,8478
31
31
  uiprotect/utils.py,sha256=jIWT7n_reL90oY91svBfQ4naRxo28qHzP5jNOL12mQE,20342
32
- uiprotect/websocket.py,sha256=D5DZrMzo434ecp8toNxOB5HM193kVwYw42yEcg99yMw,8029
33
- uiprotect-5.4.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
34
- uiprotect-5.4.0.dist-info/METADATA,sha256=M3IE7App4LAfkDVGjLCYgU0b6uog5u8RGLdsXNFJasg,11009
35
- uiprotect-5.4.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
- uiprotect-5.4.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
37
- uiprotect-5.4.0.dist-info/RECORD,,
32
+ uiprotect/websocket.py,sha256=f3YdRg4iKkvyQLz9H9rQ3RdhiEudNwWO4ONaXF6OJ4Y,8130
33
+ uiprotect-6.0.0.dist-info/LICENSE,sha256=INx18jhdbVXMEiiBANeKEbrbz57ckgzxk5uutmmcxGk,1111
34
+ uiprotect-6.0.0.dist-info/METADATA,sha256=6sFvO3w3TeFmN-tU8nvrw8lvdg_soSuCgtcDPFje2_E,11010
35
+ uiprotect-6.0.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
+ uiprotect-6.0.0.dist-info/entry_points.txt,sha256=J78AUTPrTTxgI3s7SVgrmGqDP7piX2wuuEORzhDdVRA,47
37
+ uiprotect-6.0.0.dist-info/RECORD,,