diff --git a/src/components/entity/ha-entity-marker.html b/src/components/entity/ha-entity-marker.html index ab36c656ee..8a980ec7a8 100644 --- a/src/components/entity/ha-entity-marker.html +++ b/src/components/entity/ha-entity-marker.html @@ -36,3 +36,79 @@ + + diff --git a/src/components/entity/ha-entity-marker.js b/src/components/entity/ha-entity-marker.js deleted file mode 100644 index e08b1b8304..0000000000 --- a/src/components/entity/ha-entity-marker.js +++ /dev/null @@ -1,72 +0,0 @@ -import Polymer from '../../polymer'; - -/* -Leaflet clones this element before adding it to the map. This messes up -our Poylmer object and we lose the reference to the `hass` object. - -That's why we refer here to window.hass instead of the hass property. -*/ - -export default new Polymer({ - is: 'ha-entity-marker', - - properties: { - hass: { - type: Object, - }, - - entityId: { - type: String, - value: '', - reflectToAttribute: true, - }, - - state: { - type: Object, - computed: 'computeState(entityId)', - }, - - icon: { - type: Object, - computed: 'computeIcon(state)', - }, - - image: { - type: Object, - computed: 'computeImage(state)', - }, - - value: { - type: String, - computed: 'computeValue(state)', - }, - }, - - listeners: { - tap: 'badgeTap', - }, - - badgeTap(ev) { - ev.stopPropagation(); - if (this.entityId) { - this.async(() => window.hass.moreInfoActions.selectEntity(this.entityId), 1); - } - }, - - computeState(entityId) { - return entityId && window.hass.reactor.evaluate(window.hass.entityGetters.byId(entityId)); - }, - - computeIcon(state) { - return !state && 'home'; - }, - - computeImage(state) { - return state && state.attributes.entity_picture; - }, - - computeValue(state) { - return state && - state.entityDisplay.split(' ').map(part => part.substr(0, 1)).join(''); - }, -}); diff --git a/src/components/stream-status.html b/src/components/stream-status.html index cf10d2dd4b..1e9cec0763 100644 --- a/src/components/stream-status.html +++ b/src/components/stream-status.html @@ -3,8 +3,6 @@ - -