From dd8d0fd0295dd882c2df8d0acc667e802e45d0b8 Mon Sep 17 00:00:00 2001 From: ludeeus Date: Thu, 16 Aug 2018 20:50:35 +0200 Subject: [PATCH] Added unit_of_meassurement --- VERSION | 2 +- ext-weblink.js | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index f477849..9325c3c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.2 \ No newline at end of file +0.3.0 \ No newline at end of file diff --git a/ext-weblink.js b/ext-weblink.js index 650109b..8a4cbd0 100644 --- a/ext-weblink.js +++ b/ext-weblink.js @@ -6,7 +6,11 @@ class ExtWebLink extends HTMLElement { if (!this.config.entity) { var state = ""; } else { - var state = hass.states[this.config.entity].state; + if (hass.states[this.config.entity].attributes.unit_of_meassurement) { + var state = hass.states[this.config.entity].state+' '+hass.states[this.config.entity].attributes.unit_of_meassurement; + } else { + var state = hass.states[this.config.entity].state + } } if (this.config.name) { var name = this.config.name; @@ -39,12 +43,12 @@ class ExtWebLink extends HTMLElement { } div .state { text-align: right; - padding: 12px 0px 12px 0px; + padding: 10px 0px 10px 0px; } div .name { text-align: left; overflow: visible; - padding: 12px 12px 12px 16px; + padding: 10px 12px 10px 16px; } div .main {