mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Device automations: Rename name to entity_name, introduce subtype (#3644)
This commit is contained in:
parent
cbd01f2d68
commit
2f96a096f7
@ -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
|
||||
}`
|
||||
)
|
||||
);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user