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
This commit is contained in:
Ian Richardson 2018-11-02 06:26:20 -05:00 committed by Paulus Schoutsen
parent c0c7c0f41a
commit 6cc67dc790

View File

@ -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`
<style>
:host {
display: block;
background-color: yellow;
padding: 8px;
}
</style>
`;
}
}
declare global {
interface HTMLElementTagNameMap {
"hui-error-entity-row": HuiErrorEntityRow;
}
}
customElements.define("hui-error-entity-row", HuiErrorEntityRow);