Device automations: Rename name to entity_name, introduce subtype (#3644)

This commit is contained in:
Erik Montnemery 2019-09-08 20:12:56 +02:00 committed by Bram Kragten
parent cbd01f2d68
commit 2f96a096f7

View File

@ -6,6 +6,7 @@ export interface DeviceAutomation {
domain: string; domain: string;
entity_id: string; entity_id: string;
type?: string; type?: string;
subtype?: string;
event?: string; event?: string;
} }
@ -62,8 +63,14 @@ export const localizeDeviceAutomationCondition = (
`component.${condition.domain}.device_automation.condition_type.${ `component.${condition.domain}.device_automation.condition_type.${
condition.type condition.type
}`, }`,
"name", "entity_name",
state ? compute_state_name(state) : "<unknown>" state ? compute_state_name(state) : "<unknown>",
"subtype",
hass.localize(
`component.${condition.domain}.device_automation.condition_subtype.${
condition.subtype
}`
)
); );
}; };
@ -76,7 +83,13 @@ export const localizeDeviceAutomationTrigger = (
`component.${trigger.domain}.device_automation.trigger_type.${ `component.${trigger.domain}.device_automation.trigger_type.${
trigger.type trigger.type
}`, }`,
"name", "entity_name",
state ? compute_state_name(state) : "<unknown>" state ? compute_state_name(state) : "<unknown>",
"subtype",
hass.localize(
`component.${trigger.domain}.device_automation.trigger_subtype.${
trigger.subtype
}`
)
); );
}; };