mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Remove async_add_job calls from configurator (#113256)
The plan is to deprecate `async_add_job` to reduce the number of job APIs we have to maintain. See #113179 for additional history. This one got the smallest change possible since its likely to go away as well at some point
This commit is contained in:
parent
7f37732e71
commit
9d1c683a70
@ -15,7 +15,12 @@ import functools as ft
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.const import ATTR_ENTITY_PICTURE, ATTR_FRIENDLY_NAME
|
||||
from homeassistant.core import HomeAssistant, ServiceCall, callback as async_callback
|
||||
from homeassistant.core import (
|
||||
HassJob,
|
||||
HomeAssistant,
|
||||
ServiceCall,
|
||||
callback as async_callback,
|
||||
)
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.entity import async_generate_entity_id
|
||||
from homeassistant.helpers.event import async_call_later
|
||||
@ -245,7 +250,9 @@ class Configurator:
|
||||
|
||||
# field validation goes here?
|
||||
if callback and (
|
||||
job := self.hass.async_add_job(callback, call.data.get(ATTR_FIELDS, {}))
|
||||
job := self.hass.async_add_hass_job(
|
||||
HassJob(callback), call.data.get(ATTR_FIELDS, {})
|
||||
)
|
||||
):
|
||||
await job
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user