From da071734714cbedb8daf3e6c6ed24a2d76adca64 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Fri, 8 Jan 2021 11:07:04 +0100 Subject: [PATCH] Prevent YAML mode if no entity is set in card editor (#8110) --- .../editor/config-elements/hui-humidifier-card-editor.ts | 2 +- .../editor/config-elements/hui-picture-entity-card-editor.ts | 2 +- .../editor/config-elements/hui-plant-status-card-editor.ts | 2 +- .../editor/config-elements/hui-thermostat-card-editor.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/panels/lovelace/editor/config-elements/hui-humidifier-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-humidifier-card-editor.ts index a6ebb008b1..16e9a72c06 100644 --- a/src/panels/lovelace/editor/config-elements/hui-humidifier-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-humidifier-card-editor.ts @@ -20,7 +20,7 @@ import { configElementStyle } from "./config-elements-style"; const cardConfigStruct = object({ type: string(), - entity: string(), + entity: optional(string()), name: optional(string()), theme: optional(string()), }); diff --git a/src/panels/lovelace/editor/config-elements/hui-picture-entity-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-picture-entity-card-editor.ts index 927d233888..6135c8f125 100644 --- a/src/panels/lovelace/editor/config-elements/hui-picture-entity-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-picture-entity-card-editor.ts @@ -28,7 +28,7 @@ import { configElementStyle } from "./config-elements-style"; const cardConfigStruct = object({ type: string(), - entity: string(), + entity: optional(string()), image: optional(string()), name: optional(string()), camera_image: optional(string()), diff --git a/src/panels/lovelace/editor/config-elements/hui-plant-status-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-plant-status-card-editor.ts index 5c89dfd149..0a6cd44794 100644 --- a/src/panels/lovelace/editor/config-elements/hui-plant-status-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-plant-status-card-editor.ts @@ -21,7 +21,7 @@ import { configElementStyle } from "./config-elements-style"; const cardConfigStruct = object({ type: string(), - entity: string(), + entity: optional(string()), name: optional(string()), theme: optional(string()), }); diff --git a/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts index 775b2c8e20..3eb65af6d0 100644 --- a/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts @@ -20,7 +20,7 @@ import { configElementStyle } from "./config-elements-style"; const cardConfigStruct = object({ type: string(), - entity: string(), + entity: optional(string()), name: optional(string()), theme: optional(string()), });