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;
entity_id: string;
type?: string;
subtype?: string;
event?: string;
}
@ -62,8 +63,14 @@ export const localizeDeviceAutomationCondition = (
`component.${condition.domain}.device_automation.condition_type.${
condition.type
}`,
"name",
state ? compute_state_name(state) : "<unknown>"
"entity_name",
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.${
trigger.type
}`,
"name",
state ? compute_state_name(state) : "<unknown>"
"entity_name",
state ? compute_state_name(state) : "<unknown>",
"subtype",
hass.localize(
`component.${trigger.domain}.device_automation.trigger_subtype.${
trigger.subtype
}`
)
);
};