mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Update notify to use async_add_executor_job (#41516)
This commit is contained in:
parent
5b8ecc26a4
commit
480b8165d7
@ -114,7 +114,7 @@ class BaseNotificationService:
|
|||||||
|
|
||||||
kwargs can contain ATTR_TITLE to specify a title.
|
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:
|
async def _async_notify_message_service(self, service: ServiceCall) -> None:
|
||||||
"""Handle sending notification message service calls."""
|
"""Handle sending notification message service calls."""
|
||||||
@ -238,7 +238,7 @@ async def async_setup(hass, config):
|
|||||||
hass, p_config, discovery_info
|
hass, p_config, discovery_info
|
||||||
)
|
)
|
||||||
elif hasattr(platform, "get_service"):
|
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
|
platform.get_service, hass, p_config, discovery_info
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user