From 9d1c683a706e092bba51954dc774b6aa99be8dc0 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 13 Mar 2024 18:22:40 -1000 Subject: [PATCH] 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 --- homeassistant/components/configurator/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/configurator/__init__.py b/homeassistant/components/configurator/__init__.py index e49b6b25d6c..0579df90dc9 100644 --- a/homeassistant/components/configurator/__init__.py +++ b/homeassistant/components/configurator/__init__.py @@ -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