Replace executor with async_add_job (#7658)
* Remove executor * Lint * Lint * Fix tests
This commit is contained in:
1 parent
9e9705d6b2
commit
f43db3c615
46 files changed
+196
-248
No files matched your search
@@ -140,8 +140,8 @@ def async_setup(hass, config):
|
||||
if update_tasks:
|
||||
yield from asyncio.wait(update_tasks, loop=hass.loop)
|
||||
|
||||
descriptions = yield from hass.loop.run_in_executor(
|
||||
None, load_yaml_config_file, os.path.join(
|
||||
descriptions = yield from hass.async_add_job(
|
||||
load_yaml_config_file, os.path.join(
|
||||
os.path.dirname(__file__), 'services.yaml'))
|
||||
hass.services.async_register(
|
||||
DOMAIN, SERVICE_TURN_OFF, async_handle_remote_service,
|
||||
@@ -171,5 +171,4 @@ class RemoteDevice(ToggleEntity):
|
||||
|
||||
This method must be run in the event loop and returns a coroutine.
|
||||
"""
|
||||
return self.hass.loop.run_in_executor(
|
||||
None, ft.partial(self.send_command, **kwargs))
|
||||
return self.hass.async_add_job(ft.partial(self.send_command, **kwargs))
|
||||
@@ -75,5 +75,4 @@ class KiraRemote(Entity):
|
||||
|
||||
This method must be run in the event loop and returns a coroutine.
|
||||
"""
|
||||
return self.hass.loop.run_in_executor(
|
||||
None, ft.partial(self.send_command, **kwargs))
|
||||
return self.hass.async_add_job(ft.partial(self.send_command, **kwargs))
|
||||
Reference in new issue
Block a user