Don't use selector inside choose action (#13705)

This commit is contained in:
Paul Bottein 2022-09-13 10:43:38 +02:00 committed by GitHub
parent 771733d326
commit 7696df56ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,6 @@ import { Action, ChooseAction } from "../../../../../data/script";
import { haStyle } from "../../../../../resources/styles";
import { HomeAssistant } from "../../../../../types";
import { ActionElement } from "../ha-automation-action-row";
import "../../../../../components/ha-form/ha-form";
@customElement("ha-automation-action-choose")
export class HaChooseAction extends LitElement implements ActionElement {
@ -64,13 +63,13 @@ export class HaChooseAction extends LitElement implements ActionElement {
"ui.panel.config.automation.editor.actions.type.choose.sequence"
)}:
</h3>
<ha-form
<ha-automation-action
.actions=${option.sequence || []}
.reOrderMode=${this.reOrderMode}
.hass=${this.hass}
.schema=${[{ name: "sequence", selector: { action: {} } }]}
.data=${option}
.idx=${idx}
@value-changed=${this._actionChanged}
></ha-form>
></ha-automation-action>
</div>
</ha-card>`
)}
@ -126,7 +125,7 @@ export class HaChooseAction extends LitElement implements ActionElement {
private _actionChanged(ev: CustomEvent) {
ev.stopPropagation();
const value = ev.detail.value.sequence as Action[];
const value = ev.detail.value as Action[];
const index = (ev.target as any).idx;
const choose = this.action.choose
? [...ensureArray(this.action.choose)]
@ -185,9 +184,6 @@ export class HaChooseAction extends LitElement implements ActionElement {
right: 0;
padding: 4px;
}
ha-form::part(root) {
overflow: visible;
}
ha-svg-icon {
height: 20px;
}