فهرست منبع

Wait 5s after pausing existing device before testing.

Connection is failing due to testing immediately after pausing the device, but
it needs to timeout its current poll first.
Jason Rumney 3 سال پیش
والد
کامیت
bdbaed3436
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      custom_components/tuya_local/config_flow.py

+ 2 - 0
custom_components/tuya_local/config_flow.py

@@ -1,3 +1,4 @@
+import asyncio
 import logging
 
 import voluptuous as vol
@@ -184,6 +185,7 @@ async def async_test_connection(config: dict, hass: HomeAssistant):
     existing = domain_data.get(config[CONF_DEVICE_ID]) if domain_data else None
     if existing:
         existing["device"].pause()
+        await asyncio.sleep(5)
 
     try:
         device = TuyaLocalDevice(