Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ import {
LitElement,
property,
PropertyValues,
query,
} from "lit-element";
import { dynamicElement } from "../../../../common/dom/dynamic-element-directive";
import { fireEvent } from "../../../../common/dom/fire_event";
import "../../../../components/ha-button-menu";
import "../../../../components/ha-card";
import "../../../../components/ha-svg-icon";
import type { HaYamlEditor } from "../../../../components/ha-yaml-editor";
import type { Action } from "../../../../data/script";
import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box";
import { haStyle } from "../../../../resources/styles";
Expand Down Expand Up @@ -103,6 +105,8 @@ export default class HaAutomationActionRow extends LitElement {

@internalProperty() private _yamlMode = false;

@query("ha-yaml-editor", true) private _yamlEditor?: HaYamlEditor;
Comment thread
spacegaier marked this conversation as resolved.
Outdated
Comment thread
spacegaier marked this conversation as resolved.
Outdated

protected updated(changedProperties: PropertyValues) {
if (!changedProperties.has("action")) {
return;
Expand All @@ -111,6 +115,10 @@ export default class HaAutomationActionRow extends LitElement {
if (!this._uiModeAvailable && !this._yamlMode) {
this._yamlMode = true;
}

if (this._yamlMode && this._yamlEditor) {
this._yamlEditor.setValue(this.action);
}
}

protected render() {
Expand Down