mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 12:56:37 +00:00
Warn that only automations in automations.yaml are editable (#3200)
This commit is contained in:
parent
9309c5a1b6
commit
fe80c7fe0e
@ -147,7 +147,8 @@ class HaAutomationEditor extends LitElement {
|
|||||||
"GET",
|
"GET",
|
||||||
`config/automation/config/${this.automation.attributes.id}`
|
`config/automation/config/${this.automation.attributes.id}`
|
||||||
)
|
)
|
||||||
.then((config) => {
|
.then(
|
||||||
|
(config) => {
|
||||||
// Normalize data: ensure trigger, action and condition are lists
|
// Normalize data: ensure trigger, action and condition are lists
|
||||||
// Happens when people copy paste their automations into the config
|
// Happens when people copy paste their automations into the config
|
||||||
for (const key of ["trigger", "condition", "action"]) {
|
for (const key of ["trigger", "condition", "action"]) {
|
||||||
@ -158,7 +159,22 @@ class HaAutomationEditor extends LitElement {
|
|||||||
}
|
}
|
||||||
this._dirty = false;
|
this._dirty = false;
|
||||||
this._config = config;
|
this._config = config;
|
||||||
});
|
},
|
||||||
|
(resp) => {
|
||||||
|
alert(
|
||||||
|
resp.status_code === 404
|
||||||
|
? this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.load_error_not_editable"
|
||||||
|
)
|
||||||
|
: this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.load_error_unknown",
|
||||||
|
"err_no",
|
||||||
|
resp.status_code
|
||||||
|
)
|
||||||
|
);
|
||||||
|
history.back();
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changedProps.has("creatingNew") && this.creatingNew && this.hass) {
|
if (changedProps.has("creatingNew") && this.creatingNew && this.hass) {
|
||||||
|
@ -642,6 +642,8 @@
|
|||||||
"editor": {
|
"editor": {
|
||||||
"introduction": "Use automations to bring your home alive",
|
"introduction": "Use automations to bring your home alive",
|
||||||
"default_name": "New Automation",
|
"default_name": "New Automation",
|
||||||
|
"load_error_not_editable": "Only automations in automations.yaml are editable.",
|
||||||
|
"load_error_unknown": "Error loading automation ({err_no}).",
|
||||||
"save": "Save",
|
"save": "Save",
|
||||||
"unsaved_confirm": "You have unsaved changes. Are you sure you want to leave?",
|
"unsaved_confirm": "You have unsaved changes. Are you sure you want to leave?",
|
||||||
"alias": "Name",
|
"alias": "Name",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user