Select default mode if none set (#12306)

This commit is contained in:
Paulus Schoutsen 2022-04-11 10:08:37 -07:00 committed by GitHub
parent 3c549c6b31
commit 125a601ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,8 @@ import { BlueprintInput } from "./blueprint";
import { DeviceCondition, DeviceTrigger } from "./device_automation";
import { Action, MODES } from "./script";
export const AUTOMATION_DEFAULT_MODE: ManualAutomationConfig["mode"] = "single";
export interface AutomationEntity extends HassEntityBase {
attributes: HassEntityAttributeBase & {
id?: string;

View File

@ -8,6 +8,7 @@ import "../../../components/ha-card";
import "../../../components/ha-textarea";
import "../../../components/ha-textfield";
import {
AUTOMATION_DEFAULT_MODE,
Condition,
ManualAutomationConfig,
Trigger,
@ -99,7 +100,7 @@ export class HaManualAutomationEditor extends LitElement {
.label=${this.hass.localize(
"ui.panel.config.automation.editor.modes.label"
)}
.value=${this.config.mode}
.value=${this.config.mode || AUTOMATION_DEFAULT_MODE}
@selected=${this._modeChanged}
fixedMenuPosition
>