Update nest to use async_add_executor_job (#41926)

This commit is contained in:
J. Nick Koston 2020-10-16 06:31:16 -05:00 committed by GitHub
parent 250fbd857b
commit 965bb2c8df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 8 deletions

View file

@ -24,7 +24,9 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
async def async_setup_entry(hass, entry, async_add_entities):
"""Set up a Nest sensor based on a config entry."""
camera_devices = await hass.async_add_job(hass.data[nest.DATA_NEST].cameras)
camera_devices = await hass.async_add_executor_job(
hass.data[nest.DATA_NEST].cameras
)
cameras = [NestCamera(structure, device) for structure, device in camera_devices]
async_add_entities(cameras, True)