Update notify to use async_add_executor_job (#41516)

pull/41523/head
J. Nick Koston 2020-10-08 16:58:33 -05:00 committed by GitHub
parent 5b8ecc26a4
commit 480b8165d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ class BaseNotificationService:
kwargs can contain ATTR_TITLE to specify a title.
"""
await self.hass.async_add_job(partial(self.send_message, message, **kwargs)) # type: ignore
await self.hass.async_add_executor_job(partial(self.send_message, message, **kwargs)) # type: ignore
async def _async_notify_message_service(self, service: ServiceCall) -> None:
"""Handle sending notification message service calls."""
@ -238,7 +238,7 @@ async def async_setup(hass, config):
hass, p_config, discovery_info
)
elif hasattr(platform, "get_service"):
notify_service = await hass.async_add_job(
notify_service = await hass.async_add_executor_job(
platform.get_service, hass, p_config, discovery_info
)
else: