Replace executor with async_add_job (#7658)
* Remove executor * Lint * Lint * Fix tests
This commit is contained in:
parent
9e9705d6b2
commit
f43db3c615
46 changed files with 196 additions and 248 deletions
|
@ -151,8 +151,8 @@ class EntityComponent(object):
|
|||
entity_platform.async_schedule_add_entities, discovery_info
|
||||
)
|
||||
else:
|
||||
task = self.hass.loop.run_in_executor(
|
||||
None, platform.setup_platform, self.hass, platform_config,
|
||||
task = self.hass.async_add_job(
|
||||
platform.setup_platform, self.hass, platform_config,
|
||||
entity_platform.schedule_add_entities, discovery_info
|
||||
)
|
||||
yield from asyncio.wait_for(
|
||||
|
@ -195,7 +195,7 @@ class EntityComponent(object):
|
|||
if hasattr(entity, 'async_update'):
|
||||
yield from entity.async_update()
|
||||
else:
|
||||
yield from self.hass.loop.run_in_executor(None, entity.update)
|
||||
yield from self.hass.async_add_job(entity.update)
|
||||
|
||||
if getattr(entity, 'entity_id', None) is None:
|
||||
object_id = entity.name or DEVICE_DEFAULT_NAME
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue