mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
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:
parent
c0c7c0f41a
commit
6cc67dc790
39
src/panels/lovelace/entity-rows/hui-error-entity-row.ts
Normal file
39
src/panels/lovelace/entity-rows/hui-error-entity-row.ts
Normal 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);
|
Loading…
x
Reference in New Issue
Block a user