Added support for unit_of_measurement

This commit is contained in:
Paulus Schoutsen 2014-11-08 17:45:09 -08:00
parent 5770cc03a1
commit 2ec1f20a03
4 changed files with 16 additions and 3 deletions

View file

@ -31,6 +31,9 @@ ATTR_FRIENDLY_NAME = "friendly_name"
# A picture to represent entity
ATTR_ENTITY_PICTURE = "entity_picture"
# The unit of measurement if applicable
ATTR_UNIT_OF_MEASUREMENT = "unit_of_measurement"
STATE_ON = 'on'
STATE_OFF = 'off'
STATE_HOME = 'home'

View file

@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "6d353f9599942124690691fb22c115ee"
VERSION = "eed02673a7e36fe85f2fa021373d0156"

View file

@ -20048,7 +20048,12 @@ core-item {
Object.defineProperties(State.prototype, {
"stateDisplay": {
get: function() {
return this.state.replace(/_/g, " ");
var state = this.state.replace(/_/g, " ");
if(this.attributes.unit_of_measurement) {
return state + " " + this.attributes.unit_of_measurement;
} else {
return state;
}
}
},

View file

@ -37,7 +37,12 @@
Object.defineProperties(State.prototype, {
"stateDisplay": {
get: function() {
return this.state.replace(/_/g, " ");
var state = this.state.replace(/_/g, " ");
if(this.attributes.unit_of_measurement) {
return state + " " + this.attributes.unit_of_measurement;
} else {
return state;
}
}
},