mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 01:06:35 +00:00
Convert Automation Action Choose to HA Form (#11597)
* Convert Auatomation Action Choose to HA Form * remove log * Remove Import
This commit is contained in:
parent
6a51e2aaad
commit
9eea17b793
@ -10,8 +10,8 @@ import { Condition } from "../../../../../data/automation";
|
||||
import { Action, ChooseAction } from "../../../../../data/script";
|
||||
import { haStyle } from "../../../../../resources/styles";
|
||||
import { HomeAssistant } from "../../../../../types";
|
||||
import "../ha-automation-action";
|
||||
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 {
|
||||
@ -61,12 +61,13 @@ export class HaChooseAction extends LitElement implements ActionElement {
|
||||
"ui.panel.config.automation.editor.actions.type.choose.sequence"
|
||||
)}:
|
||||
</h3>
|
||||
<ha-automation-action
|
||||
.actions=${option.sequence}
|
||||
<ha-form
|
||||
.hass=${this.hass}
|
||||
.schema=${[{ name: "sequence", selector: { action: {} } }]}
|
||||
.data=${option}
|
||||
.idx=${idx}
|
||||
@value-changed=${this._actionChanged}
|
||||
></ha-automation-action>
|
||||
></ha-form>
|
||||
</div>
|
||||
</ha-card>`
|
||||
)}
|
||||
@ -107,7 +108,7 @@ export class HaChooseAction extends LitElement implements ActionElement {
|
||||
|
||||
private _actionChanged(ev: CustomEvent) {
|
||||
ev.stopPropagation();
|
||||
const value = ev.detail.value as Action[];
|
||||
const value = ev.detail.value.sequence as Action[];
|
||||
const index = (ev.target as any).idx;
|
||||
const choose = this.action.choose
|
||||
? [...ensureArray(this.action.choose)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user