python-aidot 0.3.54b1__tar.gz → 0.3.54b2__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.54b1 → python_aidot-0.3.54b2}/PKG-INFO +1 -1
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/aidot/device_client.py +10 -8
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/python_aidot.egg-info/PKG-INFO +1 -1
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/setup.py +1 -1
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/LICENSE +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/README.md +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/aidot/__init__.py +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/aidot/aes_utils.py +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/aidot/client.py +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/aidot/const.py +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/aidot/discover.py +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/aidot/exceptions.py +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/aidot/login_const.py +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/python_aidot.egg-info/SOURCES.txt +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/python_aidot.egg-info/dependency_links.txt +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/python_aidot.egg-info/requires.txt +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/python_aidot.egg-info/top_level.txt +0 -0
- {python_aidot-0.3.54b1 → python_aidot-0.3.54b2}/setup.cfg +0 -0
|
@@ -123,6 +123,8 @@ class DeviceClient(object):
|
|
|
123
123
|
writer: Any = None
|
|
124
124
|
reader: Any = None
|
|
125
125
|
syncProperties = [CONF_ON_OFF, CONF_DIMMING, CONF_RGBW, CONF_CCT]
|
|
126
|
+
heart_time = 10
|
|
127
|
+
# syncProperties = []
|
|
126
128
|
_TAG: str = "DeviceClient"
|
|
127
129
|
@property
|
|
128
130
|
def connect_and_login(self) -> bool:
|
|
@@ -148,7 +150,10 @@ class DeviceClient(object):
|
|
|
148
150
|
self.password = device.get(CONF_PASSWORD)
|
|
149
151
|
self.device_id = device.get(CONF_ID)
|
|
150
152
|
self._simpleVersion = device.get("simpleVersion")
|
|
151
|
-
self._TAG = f"{self.device_id}"
|
|
153
|
+
self._TAG = f"{self.device_id}"
|
|
154
|
+
# if self.info.model_id == 'lk.WIFI-RGBWLight-D0006':
|
|
155
|
+
# self.syncProperties = [CONF_ON_OFF, CONF_DIMMING, CONF_RGBW, CONF_CCT]
|
|
156
|
+
|
|
152
157
|
_LOGGER.warning(f"{self._TAG}:{device}")
|
|
153
158
|
|
|
154
159
|
async def connect(self, ip_address) -> None:
|
|
@@ -236,6 +241,7 @@ class DeviceClient(object):
|
|
|
236
241
|
|
|
237
242
|
self.ascNumber = json_data[CONF_PAYLOAD][CONF_ASCNUMBER] + 1
|
|
238
243
|
self.status.online = True
|
|
244
|
+
self._notify_status_update()
|
|
239
245
|
self._receive_task = asyncio.create_task(
|
|
240
246
|
self.receive_data(),
|
|
241
247
|
name=f"aidot_receive_{self.device_id}"
|
|
@@ -290,7 +296,7 @@ class DeviceClient(object):
|
|
|
290
296
|
def _schedule_ping(self):
|
|
291
297
|
loop = asyncio.get_running_loop()
|
|
292
298
|
loop.create_task(self.send_ping_action())
|
|
293
|
-
self._ping_timer = loop.call_later(
|
|
299
|
+
self._ping_timer = loop.call_later(self.heart_time, self._schedule_ping)
|
|
294
300
|
|
|
295
301
|
async def send_dev_attr(self, dev_attr) -> None:
|
|
296
302
|
if not self._connect_and_login:
|
|
@@ -384,8 +390,8 @@ class DeviceClient(object):
|
|
|
384
390
|
return -1
|
|
385
391
|
if self._connect_and_login is False:
|
|
386
392
|
return -1
|
|
387
|
-
self.writer.write(self.get_send_packet(json.dumps(ping).encode(), 2))
|
|
388
|
-
await self.writer.drain()
|
|
393
|
+
# self.writer.write(self.get_send_packet(json.dumps(ping).encode(), 2))
|
|
394
|
+
# await self.writer.drain()
|
|
389
395
|
self.ping_count += 1
|
|
390
396
|
await self.send_action(self.syncProperties, CONF_GET_DEV_ATTR_REQ)
|
|
391
397
|
return 1
|
|
@@ -433,9 +439,5 @@ class DeviceClient(object):
|
|
|
433
439
|
"""延迟重连"""
|
|
434
440
|
_LOGGER.info(f"{self.device_id} _schedule_reconnect")
|
|
435
441
|
loop = asyncio.get_running_loop()
|
|
436
|
-
# self._reconnect_handle = loop.call_later(
|
|
437
|
-
# 10, # 10秒后重连
|
|
438
|
-
# lambda: asyncio.create_task(self.async_login())
|
|
439
|
-
# )
|
|
440
442
|
self._reconnect_handle = loop.call_later(60, self._schedule_reconnect)
|
|
441
443
|
self._login_task = asyncio.create_task(self.async_login())
|
|
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
|
|
File without changes
|