-
${this._renderContent()}
+
+
+ ${this._renderContent()}
+
{
- if (!this.hass || !this.stateObj) {
- return;
- }
- await this.hass.callService("automation", "turn_on", {
- entity_id: this.stateObj.entity_id,
- });
- }
-
private _saveAutomation() {
this._closeSidebar();
fireEvent(this, "save-automation");
@@ -656,9 +636,8 @@ export class HaManualAutomationEditor extends LitElement {
line-height: 0;
}
- ha-alert {
- display: block;
- margin-bottom: 16px;
+ .description {
+ margin-top: 16px;
}
`,
];
diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts
index 584a999fd8..27199efb9a 100644
--- a/src/panels/config/script/ha-script-editor.ts
+++ b/src/panels/config/script/ha-script-editor.ts
@@ -384,60 +384,6 @@ export class HaScriptEditor extends SubscribeMixin(
-
- ${this._errors || stateObj?.state === UNAVAILABLE
- ? html`
- ${this._errors || this._validationErrors}
- ${stateObj?.state === UNAVAILABLE
- ? html``
- : nothing}
- `
- : nothing}
- ${this._blueprintConfig
- ? html`
- ${this.hass.localize(
- "ui.panel.config.script.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.script.editor.read_only"
- )}
-
- ${this.hass.localize(
- "ui.panel.config.script.editor.migrate"
- )}
-
- `
- : nothing}
-
${this._mode === "gui"
? html`
@@ -467,7 +413,68 @@ export class HaScriptEditor extends SubscribeMixin(
@value-changed=${this._valueChanged}
@editor-save=${this._handleSaveScript}
@save-script=${this._handleSaveScript}
- >
+ >
+
+ ${this._errors || stateObj?.state === UNAVAILABLE
+ ? html`
+ ${this._errors || this._validationErrors}
+ ${stateObj?.state === UNAVAILABLE
+ ? html``
+ : nothing}
+ `
+ : nothing}
+ ${this._blueprintConfig
+ ? html`
+ ${this.hass.localize(
+ "ui.panel.config.script.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.script.editor.read_only"
+ )}
+
+ ${this.hass.localize(
+ "ui.panel.config.script.editor.migrate"
+ )}
+
+ `
+ : nothing}
+
+
`}
`
@@ -1092,6 +1099,26 @@ export class HaScriptEditor extends SubscribeMixin(
border-radius: var(--ha-border-radius-sm);
}
+ .alert-wrapper {
+ position: sticky;
+ top: -24px;
+ margin-top: -24px;
+ margin-bottom: 8px;
+ z-index: 100;
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 8px;
+ }
+
+ .alert-wrapper ha-alert {
+ background-color: var(--card-background-color);
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
+ border-radius: var(--ha-border-radius-sm);
+ margin-bottom: 0;
+ }
+
manual-script-editor {
max-width: 1540px;
padding: 0 12px;
diff --git a/src/panels/config/script/manual-script-editor.ts b/src/panels/config/script/manual-script-editor.ts
index c699b8f11a..439bd6aad3 100644
--- a/src/panels/config/script/manual-script-editor.ts
+++ b/src/panels/config/script/manual-script-editor.ts
@@ -201,7 +201,10 @@ export class HaManualScriptEditor extends LitElement {
})}
>
-
${this._renderContent()}
+
+
+ ${this._renderContent()}
+