diff --git a/src/panels/config/automation/blueprint-automation-editor.ts b/src/panels/config/automation/blueprint-automation-editor.ts
index 959230be5f97..78b4a2375bfe 100644
--- a/src/panels/config/automation/blueprint-automation-editor.ts
+++ b/src/panels/config/automation/blueprint-automation-editor.ts
@@ -20,14 +20,6 @@ export class HaBlueprintAutomationEditor extends HaBlueprintGenericEditor {
protected render() {
return html`
- ${this.disabled
- ? html`
- ${this.hass.localize("ui.panel.config.automation.editor.read_only")}
-
- ${this.hass.localize("ui.panel.config.automation.editor.migrate")}
-
- `
- : nothing}
${this.stateObj?.state === "off"
? html`
diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts
index 939c00af531c..cd7ab59477a7 100644
--- a/src/panels/config/automation/ha-automation-editor.ts
+++ b/src/panels/config/automation/ha-automation-editor.ts
@@ -81,9 +81,9 @@ declare global {
unsub?: UnsubscribeFunc;
};
"ui-mode-not-available": Error;
- duplicate: undefined;
"move-down": undefined;
"move-up": undefined;
+ duplicate: undefined;
}
}
@@ -116,6 +116,8 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
@state() private _validationErrors?: (string | TemplateResult)[];
+ @state() private _blueprintConfig?: BlueprintAutomationConfig;
+
private _configSubscriptions: Record<
string,
(config?: AutomationConfig) => void
@@ -200,7 +202,9 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
${this.hass.localize("ui.panel.config.automation.editor.rename")}
@@ -224,7 +228,8 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
: nothing}
@@ -244,7 +249,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
${this.hass.localize(
"ui.panel.config.automation.editor.take_control"
@@ -337,6 +342,32 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
: nothing}
`
: ""}
+ ${this._blueprintConfig
+ ? html`
+ ${this.hass.localize(
+ "ui.panel.config.automation.editor.confirm_take_control"
+ )}
+
+ ${this.hass.localize("ui.common.yes")}
+ ${this.hass.localize("ui.common.no")}
+
+ `
+ : this._readOnly
+ ? html`${this.hass.localize(
+ "ui.panel.config.automation.editor.read_only"
+ )}
+
+ ${this.hass.localize(
+ "ui.panel.config.automation.editor.migrate"
+ )}
+
+ `
+ : nothing}
${this._mode === "gui"
? html`
`
: html`
@@ -366,25 +396,12 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
.config=${this._config}
.disabled=${Boolean(this._readOnly)}
@value-changed=${this._valueChanged}
- @duplicate=${this._duplicate}
>
`}
`
: this._mode === "yaml"
- ? html` ${this._readOnly
- ? html`
- ${this.hass.localize(
- "ui.panel.config.automation.editor.read_only"
- )}
-
- ${this.hass.localize(
- "ui.panel.config.automation.editor.migrate"
- )}
-
- `
- : nothing}
- ${stateObj?.state === "off"
+ ? html`${stateObj?.state === "off"
? html`
${this.hass.localize(
@@ -409,7 +426,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
ha-alert {
margin: 0 auto;
max-width: 1040px;
padding: 28px 20px 0;
+ display: block;
}
ha-yaml-editor {
flex-grow: 1;
diff --git a/src/panels/config/automation/manual-automation-editor.ts b/src/panels/config/automation/manual-automation-editor.ts
index ceb4da52e033..3e7a23c2f948 100644
--- a/src/panels/config/automation/manual-automation-editor.ts
+++ b/src/panels/config/automation/manual-automation-editor.ts
@@ -38,14 +38,6 @@ export class HaManualAutomationEditor extends LitElement {
protected render() {
return html`
- ${this.disabled
- ? html`
- ${this.hass.localize("ui.panel.config.automation.editor.read_only")}
-
- ${this.hass.localize("ui.panel.config.automation.editor.migrate")}
-
- `
- : nothing}
${this.stateObj?.state === "off"
? html`
@@ -238,10 +230,6 @@ export class HaManualAutomationEditor extends LitElement {
});
}
- private _duplicate() {
- fireEvent(this, "duplicate");
- }
-
static get styles(): CSSResultGroup {
return [
haStyle,
@@ -280,12 +268,6 @@ export class HaManualAutomationEditor extends LitElement {
font-weight: normal;
line-height: 0;
}
- ha-alert.re-order {
- display: block;
- margin-bottom: 16px;
- border-radius: var(--ha-card-border-radius, 12px);
- overflow: hidden;
- }
`,
];
}
diff --git a/src/panels/config/blueprint/blueprint-generic-editor.ts b/src/panels/config/blueprint/blueprint-generic-editor.ts
index bae63f6dc7e3..85d7083a8a8e 100644
--- a/src/panels/config/blueprint/blueprint-generic-editor.ts
+++ b/src/panels/config/blueprint/blueprint-generic-editor.ts
@@ -3,7 +3,6 @@ import { css, CSSResultGroup, html, LitElement, nothing } from "lit";
import { customElement, property, state } from "lit/decorators";
import { fireEvent } from "../../../common/dom/fire_event";
import { nestedArrayMove } from "../../../common/util/array-move";
-import "../../../components/ha-alert";
import "../../../components/ha-blueprint-picker";
import "../../../components/ha-card";
import "../../../components/ha-circular-progress";
@@ -126,14 +125,14 @@ export abstract class HaBlueprintGenericEditor extends LitElement {
);
const expanded = !section.collapsed || anyRequired;
- return html`
ha-alert {
margin: 0 auto;
max-width: 1040px;
padding: 28px 20px 0;
+ display: block;
}
.config-container ha-alert {
margin-bottom: 16px;
diff --git a/src/panels/config/script/manual-script-editor.ts b/src/panels/config/script/manual-script-editor.ts
index f5f946229dd7..63f0b555e4f5 100644
--- a/src/panels/config/script/manual-script-editor.ts
+++ b/src/panels/config/script/manual-script-editor.ts
@@ -60,14 +60,6 @@ export class HaManualScriptEditor extends LitElement {
protected render() {
return html`
- ${this.disabled
- ? html`
- ${this.hass.localize("ui.panel.config.script.editor.read_only")}
-
- ${this.hass.localize("ui.panel.config.script.editor.migrate")}
-
- `
- : nothing}
${this.config.description
? html`