From 6cc67dc7908f4109abd36f01ea2927defd72cf01 Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Fri, 2 Nov 2018 06:26:20 -0500 Subject: [PATCH] New warning row for non-existent entities (#1946) * New warning row for non-existent entities * Update src/panels/lovelace/entity-rows/hui-error-entity-row.ts * Address my own comments --- .../entity-rows/hui-error-entity-row.ts | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/panels/lovelace/entity-rows/hui-error-entity-row.ts diff --git a/src/panels/lovelace/entity-rows/hui-error-entity-row.ts b/src/panels/lovelace/entity-rows/hui-error-entity-row.ts new file mode 100644 index 0000000000..dcb68c57d6 --- /dev/null +++ b/src/panels/lovelace/entity-rows/hui-error-entity-row.ts @@ -0,0 +1,39 @@ +import { html, LitElement } from "@polymer/lit-element"; +import { TemplateResult } from "lit-html"; + +class HuiErrorEntityRow extends LitElement { + public entity?: string; + + static get properties() { + return { + entity: {}, + }; + } + + protected render(): TemplateResult { + return html` + ${this.renderStyle()} + Entity not available: ${this.entity || ""} + `; + } + + private renderStyle(): TemplateResult { + return html` + + `; + } +} + +declare global { + interface HTMLElementTagNameMap { + "hui-error-entity-row": HuiErrorEntityRow; + } +} + +customElements.define("hui-error-entity-row", HuiErrorEntityRow);