diff --git a/src/data/device_automation.ts b/src/data/device_automation.ts index b62a7ca8e4e7..677e0a73ead2 100644 --- a/src/data/device_automation.ts +++ b/src/data/device_automation.ts @@ -1,7 +1,7 @@ import { computeStateName } from "../common/entity/compute_state_name"; import type { HaFormSchema } from "../components/ha-form/types"; import { HomeAssistant } from "../types"; -import { BaseTrigger } from "./automation"; +import { BaseTrigger, migrateAutomationTrigger } from "./automation"; import { computeEntityRegistryName, entityRegistryByEntityId, @@ -51,10 +51,12 @@ export const fetchDeviceConditions = (hass: HomeAssistant, deviceId: string) => }); export const fetchDeviceTriggers = (hass: HomeAssistant, deviceId: string) => - hass.callWS({ - type: "device_automation/trigger/list", - device_id: deviceId, - }); + hass + .callWS({ + type: "device_automation/trigger/list", + device_id: deviceId, + }) + .then((triggers) => migrateAutomationTrigger(triggers) as DeviceTrigger[]); export const fetchDeviceActionCapabilities = ( hass: HomeAssistant,