From 822ad0ae9ce1a91ca4c3b986e2398c91f8581847 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 9 Oct 2020 02:28:55 -0500 Subject: [PATCH] Update arcam_fmj device trigger to use async_run_hass_job (#41530) --- homeassistant/components/arcam_fmj/device_trigger.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/arcam_fmj/device_trigger.py b/homeassistant/components/arcam_fmj/device_trigger.py index 40feb63f9f3..c03a082c149 100644 --- a/homeassistant/components/arcam_fmj/device_trigger.py +++ b/homeassistant/components/arcam_fmj/device_trigger.py @@ -13,7 +13,7 @@ from homeassistant.const import ( CONF_PLATFORM, CONF_TYPE, ) -from homeassistant.core import CALLBACK_TYPE, Event, HomeAssistant, callback +from homeassistant.core import CALLBACK_TYPE, Event, HassJob, HomeAssistant, callback from homeassistant.helpers import config_validation as cv, entity_registry from homeassistant.helpers.typing import ConfigType @@ -57,6 +57,7 @@ async def async_attach_trigger( ) -> CALLBACK_TYPE: """Attach a trigger.""" config = TRIGGER_SCHEMA(config) + job = HassJob(action) if config[CONF_TYPE] == "turn_on": entity_id = config[CONF_ENTITY_ID] @@ -64,8 +65,8 @@ async def async_attach_trigger( @callback def _handle_event(event: Event): if event.data[ATTR_ENTITY_ID] == entity_id: - hass.async_run_job( - action, + hass.async_run_hass_job( + job, {"trigger": {**config, "description": f"{DOMAIN} - {entity_id}"}}, event.context, )