Fix entity marker (#10787)

This commit is contained in:
Bram Kragten
2021-12-03 18:04:50 +01:00
committed by GitHub
parent a283acaabf
commit d43d19190e
3 changed files with 10 additions and 8 deletions

View File

@@ -2,11 +2,8 @@ import { LitElement, html, css } from "lit";
import { property } from "lit/decorators";
import { styleMap } from "lit/directives/style-map";
import { fireEvent } from "../../common/dom/fire_event";
import { HomeAssistant } from "../../types";
class HaEntityMarker extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@property({ attribute: "entity-id" }) public entityId?: string;
@property({ attribute: "entity-name" }) public entityName?: string;
@@ -26,9 +23,7 @@ class HaEntityMarker extends LitElement {
? html`<div
class="entity-picture"
style=${styleMap({
"background-image": `url(${this.hass.hassUrl(
this.entityPicture
)})`,
"background-image": `url(${this.entityPicture})`,
})}
></div>`
: this.entityName}
@@ -69,3 +64,9 @@ class HaEntityMarker extends LitElement {
}
customElements.define("ha-entity-marker", HaEntityMarker);
declare global {
interface HTMLElementTagNameMap {
"ha-entity-marker": HaEntityMarker;
}
}