Skip to content
This repository has been archived by the owner on May 28, 2022. It is now read-only.

Commit

Permalink
Added unit_of_meassurement
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Aug 16, 2018
1 parent 3588bea commit dd8d0fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.2
0.3.0
10 changes: 7 additions & 3 deletions ext-weblink.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit dd8d0fd

Please sign in to comment.