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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-aidot
3
- Version: 0.3.54b1
3
+ Version: 0.3.54b2
4
4
  Summary: aidot control wifi lights
5
5
  Home-page: https://github.com/Aidot-Development-Team/python-aidot
6
6
  Author: aidotdev2024
@@ -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(30, self._schedule_ping)
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())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-aidot
3
- Version: 0.3.54b1
3
+ Version: 0.3.54b2
4
4
  Summary: aidot control wifi lights
5
5
  Home-page: https://github.com/Aidot-Development-Team/python-aidot
6
6
  Author: aidotdev2024
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="python-aidot",
8
- version="0.3.54b1",
8
+ version="0.3.54b2",
9
9
  author="aidotdev2024",
10
10
  url='https://github.com/Aidot-Development-Team/python-aidot',
11
11
  description="aidot control wifi lights",
File without changes