Skip to content

Commit

Permalink
migrate device automation triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed Sep 24, 2024
1 parent 206d5fd commit ab673a1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/data/device_automation.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -51,10 +51,12 @@ export const fetchDeviceConditions = (hass: HomeAssistant, deviceId: string) =>
});

export const fetchDeviceTriggers = (hass: HomeAssistant, deviceId: string) =>
hass.callWS<DeviceTrigger[]>({
type: "device_automation/trigger/list",
device_id: deviceId,
});
hass
.callWS<DeviceTrigger[]>({
type: "device_automation/trigger/list",
device_id: deviceId,
})
.then((triggers) => migrateAutomationTrigger(triggers) as DeviceTrigger[]);

export const fetchDeviceActionCapabilities = (
hass: HomeAssistant,
Expand Down

0 comments on commit ab673a1

Please sign in to comment.