فهرست منبع

Call async_add_executor_job correctly.

Must call it with pointer to function, and args as separate arguments.
Was calling it with the result of calling the function inline, which doesn't
run the fuction asynchronously, and causes an error.
Jason Rumney 4 سال پیش
والد
کامیت
752845f6e6
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      custom_components/tuya_local/device.py

+ 1 - 1
custom_components/tuya_local/device.py

@@ -148,7 +148,7 @@ class TuyaLocalDevice(object):
         await self._hass.async_add_executor_job(self.set_property, dps_id, value)
         await self._hass.async_add_executor_job(self.set_property, dps_id, value)
 
 
     async def async_set_properties(self, dps_map):
     async def async_set_properties(self, dps_map):
-        await self._hass.async_add_executor_job(self._set_properties(dps_map))
+        await self._hass.async_add_executor_job(self._set_properties, dps_map)
 
 
     def anticipate_property_value(self, dps_id, value):
     def anticipate_property_value(self, dps_id, value):
         """
         """