From 431680a0127bd3b3b96a1237bcfc273aaca50242 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 25 Sep 2015 07:43:35 -0700 Subject: [PATCH] Map marker show abbreviated name --- src/components/entity/ha-entity-marker.html | 1 + src/components/entity/ha-entity-marker.js | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/entity/ha-entity-marker.html b/src/components/entity/ha-entity-marker.html index 7e180bd329..047034a2a2 100644 --- a/src/components/entity/ha-entity-marker.html +++ b/src/components/entity/ha-entity-marker.html @@ -30,6 +30,7 @@ + diff --git a/src/components/entity/ha-entity-marker.js b/src/components/entity/ha-entity-marker.js index ba555a03d8..3cb5266eec 100644 --- a/src/components/entity/ha-entity-marker.js +++ b/src/components/entity/ha-entity-marker.js @@ -31,6 +31,11 @@ export default new Polymer({ type: Object, computed: 'computeImage(state)', }, + + value: { + type: String, + computed: 'computeValue(state)', + }, }, listeners: { @@ -49,13 +54,15 @@ export default new Polymer({ }, computeIcon(state) { - return state ? - !state.attributes.entity_picture && domainIcon(state.domain) : - 'home'; + 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(''); + }, });