mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 17:56:46 +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;
|
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
|
||||||
|
}`
|
||||||
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user