python-aidot 0.3.3__tar.gz → 0.3.4__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.
- {python_aidot-0.3.3 → python_aidot-0.3.4}/PKG-INFO +1 -1
- {python_aidot-0.3.3 → python_aidot-0.3.4}/aidot/client.py +7 -3
- {python_aidot-0.3.3 → python_aidot-0.3.4}/aidot/device_client.py +1 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/python_aidot.egg-info/PKG-INFO +1 -1
- {python_aidot-0.3.3 → python_aidot-0.3.4}/setup.py +1 -1
- {python_aidot-0.3.3 → python_aidot-0.3.4}/LICENSE +0 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/README.md +0 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/aidot/__init__.py +0 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/aidot/aes_utils.py +0 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/aidot/const.py +0 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/aidot/discover.py +0 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/aidot/exceptions.py +0 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/aidot/login_const.py +0 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/python_aidot.egg-info/SOURCES.txt +0 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/python_aidot.egg-info/dependency_links.txt +0 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/python_aidot.egg-info/requires.txt +0 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/python_aidot.egg-info/top_level.txt +0 -0
- {python_aidot-0.3.3 → python_aidot-0.3.4}/setup.cfg +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""The aidot integration."""
|
|
2
2
|
|
|
3
|
+
import asyncio
|
|
3
4
|
import logging
|
|
4
5
|
import base64
|
|
5
6
|
import aiohttp
|
|
@@ -75,7 +76,6 @@ class AidotClient:
|
|
|
75
76
|
self.country_name = country_name
|
|
76
77
|
self.username = username
|
|
77
78
|
self.password = password
|
|
78
|
-
self.login_info = token.copy()
|
|
79
79
|
self._device_clients = {}
|
|
80
80
|
for item in SUPPORTED_COUNTRYS:
|
|
81
81
|
if item["name"] == self.country_name:
|
|
@@ -83,6 +83,7 @@ class AidotClient:
|
|
|
83
83
|
self._base_url = f"https://prod-{self._region}-api.arnoo.com/v17"
|
|
84
84
|
break
|
|
85
85
|
if token is not None:
|
|
86
|
+
self.login_info = token.copy()
|
|
86
87
|
self.username = token[CONF_USERNAME]
|
|
87
88
|
self.password = token[CONF_PASSWORD]
|
|
88
89
|
self._region = token[CONF_REGION]
|
|
@@ -226,12 +227,13 @@ class AidotClient:
|
|
|
226
227
|
if device_client is None:
|
|
227
228
|
device_client = DeviceClient(device, self.login_info)
|
|
228
229
|
self._device_clients[device_id] = device_client
|
|
230
|
+
asyncio.get_running_loop().create_task(device_client.ping_task())
|
|
229
231
|
if self._discover is not None:
|
|
230
232
|
ip = self._discover.discovered_device.get(device_id)
|
|
231
233
|
device_client.update_ip_address(ip)
|
|
232
234
|
return device_client
|
|
233
235
|
|
|
234
|
-
|
|
236
|
+
def start_discover(self) -> None:
|
|
235
237
|
if self._discover is not None:
|
|
236
238
|
return
|
|
237
239
|
|
|
@@ -242,7 +244,7 @@ class AidotClient:
|
|
|
242
244
|
device_client.update_ip_address(device_ip)
|
|
243
245
|
|
|
244
246
|
self._discover = Discover(self.login_info, _discover_callback)
|
|
245
|
-
|
|
247
|
+
asyncio.get_running_loop().create_task(self._discover.repeat_broadcast())
|
|
246
248
|
|
|
247
249
|
def stop_discover(self) -> None:
|
|
248
250
|
self._discover.close()
|
|
@@ -250,4 +252,6 @@ class AidotClient:
|
|
|
250
252
|
|
|
251
253
|
def cleanup(self) -> None:
|
|
252
254
|
self.stop_discover()
|
|
255
|
+
for client in self._device_clients.values():
|
|
256
|
+
asyncio.get_running_loop().create_task(client.close())
|
|
253
257
|
self._device_clients.clear()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|