From fca530411f5a6390517f75d807e0dee12aaec2e9 Mon Sep 17 00:00:00 2001 From: Aidan Timson Date: Wed, 6 Aug 2025 17:52:41 +0100 Subject: [PATCH] Fix Mod-S (Ctrl-S/Cmd-S) support for automation/scene/script YAML editors (#26412) * Fix automation and script yaml mode Mod-S (Ctrl/Cmd-S) support * Fix manual script editor * Fix manual automation editor save * Fix scene yaml mode --- src/panels/config/automation/ha-automation-editor.ts | 2 ++ src/panels/config/scene/ha-scene-editor.ts | 1 + src/panels/config/script/ha-script-editor.ts | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index f8141b2e32..4e415d8104 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -487,6 +487,7 @@ export class HaAutomationEditor extends PreventUnsavedMixin( .disabled=${Boolean(this._readOnly)} .dirty=${this._dirty} @value-changed=${this._valueChanged} + @editor-save=${this._handleSaveAutomation} > `} @@ -517,6 +518,7 @@ export class HaAutomationEditor extends PreventUnsavedMixin( .defaultValue=${this._preprocessYaml()} .readOnly=${this._readOnly} @value-changed=${this._yamlChanged} + @editor-save=${this._handleSaveAutomation} .showErrors=${false} disable-fullscreen >` diff --git a/src/panels/config/scene/ha-scene-editor.ts b/src/panels/config/scene/ha-scene-editor.ts index 294456eff6..9ce12c459f 100644 --- a/src/panels/config/scene/ha-scene-editor.ts +++ b/src/panels/config/scene/ha-scene-editor.ts @@ -320,6 +320,7 @@ export class HaSceneEditor extends PreventUnsavedMixin( .hass=${this.hass} .defaultValue=${this._config} @value-changed=${this._yamlChanged} + @editor-save=${this._saveScene} .showErrors=${false} disable-fullscreen >`; diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index d4de309046..0b9ee25c58 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -438,6 +438,7 @@ export class HaScriptEditor extends SubscribeMixin( .disabled=${this._readOnly} .dirty=${this._dirty} @value-changed=${this._valueChanged} + @editor-save=${this._handleSave} > `} @@ -450,6 +451,7 @@ export class HaScriptEditor extends SubscribeMixin( .readOnly=${this._readOnly} disable-fullscreen @value-changed=${this._yamlChanged} + @editor-save=${this._handleSave} .showErrors=${false} >` : nothing}