Cleanup run_callback_threadsafe (#6187)
* Cleanup run_callback_threadsafe * fix spell * Revert image_processing, they need to wait for update
This commit is contained in:
parent
1cd1facbd0
commit
106b7a9d8f
7 changed files with 15 additions and 32 deletions
|
@ -16,7 +16,6 @@ from homeassistant.helpers import config_validation as cv
|
|||
from homeassistant.helpers.entity import async_generate_entity_id
|
||||
from homeassistant.util import slugify
|
||||
from homeassistant.config import load_yaml_config_file
|
||||
from homeassistant.util.async import run_callback_threadsafe
|
||||
|
||||
DOMAIN = 'persistent_notification'
|
||||
ENTITY_ID_FORMAT = DOMAIN + '.{}'
|
||||
|
@ -39,9 +38,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
def create(hass, message, title=None, notification_id=None):
|
||||
"""Generate a notification."""
|
||||
run_callback_threadsafe(
|
||||
hass.loop, async_create, hass, message, title, notification_id
|
||||
).result()
|
||||
hass.add_job(async_create, hass, message, title, notification_id)
|
||||
|
||||
|
||||
@callback
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue