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:
J. Nick Koston 2024-03-13 18:22:40 -10:00 committed by GitHub
parent 7f37732e71
commit 9d1c683a70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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