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 38ee6a87ee..fbae156c62 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 @@ -1,16 +1,13 @@ -import "@polymer/paper-input/paper-input"; -import { CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import "../../../../components/ha-form/ha-form"; +import { html, LitElement, TemplateResult } from "lit"; import { customElement, property, state } from "lit/decorators"; import { assert, assign, object, optional, string } from "superstruct"; import { fireEvent } from "../../../../common/dom/fire_event"; -import "../../../../components/entity/ha-entity-picker"; -import { HomeAssistant } from "../../../../types"; -import { ThermostatCardConfig } from "../../cards/types"; -import "../../components/hui-theme-select-editor"; -import { LovelaceCardEditor } from "../../types"; +import type { HaFormSchema } from "../../../../components/ha-form/types"; +import type { HomeAssistant } from "../../../../types"; +import type { ThermostatCardConfig } from "../../cards/types"; +import type { LovelaceCardEditor } from "../../types"; import { baseLovelaceCardConfig } from "../structs/base-card-struct"; -import { EditorTarget, EntitiesEditorEvent } from "../types"; -import { configElementStyle } from "./config-elements-style"; const cardConfigStruct = assign( baseLovelaceCardConfig, @@ -21,7 +18,17 @@ const cardConfigStruct = assign( }) ); -const includeDomains = ["climate"]; +const SCHEMA: HaFormSchema[] = [ + { name: "entity", selector: { entity: { domain: "climate" } } }, + { + type: "grid", + name: "", + schema: [ + { name: "name", required: false, selector: { text: {} } }, + { name: "theme", required: false, selector: { theme: {} } }, + ], + }, +]; @customElement("hui-thermostat-card-editor") export class HuiThermostatCardEditor @@ -37,81 +44,39 @@ export class HuiThermostatCardEditor this._config = config; } - get _entity(): string { - return this._config!.entity || ""; - } - - get _name(): string { - return this._config!.name || ""; - } - - get _theme(): string { - return this._config!.theme || ""; - } - protected render(): TemplateResult { if (!this.hass || !this._config) { return html``; } return html` -