Added support for unit_of_measurement
This commit is contained in:
parent
5770cc03a1
commit
2ec1f20a03
4 changed files with 16 additions and 3 deletions
|
@ -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'
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
""" DO NOT MODIFY. Auto-generated by build_frontend script """
|
||||
VERSION = "6d353f9599942124690691fb22c115ee"
|
||||
VERSION = "eed02673a7e36fe85f2fa021373d0156"
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue