diff --git a/homeassistant/components/device_tracker/legacy.py b/homeassistant/components/device_tracker/legacy.py index 3157a00aa9f..038fad06680 100644 --- a/homeassistant/components/device_tracker/legacy.py +++ b/homeassistant/components/device_tracker/legacy.py @@ -479,7 +479,7 @@ class DeviceScanner: async def async_scan_devices(self) -> Any: """Scan for devices.""" - return await self.hass.async_add_job(self.scan_devices) + return await self.hass.async_add_executor_job(self.scan_devices) def get_device_name(self, device: str) -> str: """Get the name of a device.""" @@ -487,7 +487,7 @@ class DeviceScanner: async def async_get_device_name(self, device: str) -> Any: """Get the name of a device.""" - return await self.hass.async_add_job(self.get_device_name, device) + return await self.hass.async_add_executor_job(self.get_device_name, device) def get_extra_attributes(self, device: str) -> dict: """Get the extra attributes of a device.""" @@ -495,7 +495,7 @@ class DeviceScanner: async def async_get_extra_attributes(self, device: str) -> Any: """Get the extra attributes of a device.""" - return await self.hass.async_add_job(self.get_extra_attributes, device) + return await self.hass.async_add_executor_job(self.get_extra_attributes, device) async def async_load_config( @@ -522,7 +522,7 @@ async def async_load_config( ) result = [] try: - devices = await hass.async_add_job(load_yaml_config_file, path) + devices = await hass.async_add_executor_job(load_yaml_config_file, path) except HomeAssistantError as err: LOGGER.error("Unable to load %s: %s", path, str(err)) return [] diff --git a/homeassistant/components/device_tracker/setup.py b/homeassistant/components/device_tracker/setup.py index 6d1d81634bd..133ea4eb414 100644 --- a/homeassistant/components/device_tracker/setup.py +++ b/homeassistant/components/device_tracker/setup.py @@ -60,7 +60,7 @@ class DeviceTrackerPlatform: hass, {DOMAIN: self.config} ) elif hasattr(self.platform, "get_scanner"): - scanner = await hass.async_add_job( + scanner = await hass.async_add_executor_job( self.platform.get_scanner, hass, {DOMAIN: self.config} ) elif hasattr(self.platform, "async_setup_scanner"): @@ -68,7 +68,7 @@ class DeviceTrackerPlatform: hass, self.config, tracker.async_see, discovery_info ) elif hasattr(self.platform, "setup_scanner"): - setup = await hass.async_add_job( + setup = await hass.async_add_executor_job( self.platform.setup_scanner, hass, self.config,