diff --git a/homeassistant/components/__init__.py b/homeassistant/components/__init__.py index 663393f9c15..063f5e01939 100644 --- a/homeassistant/components/__init__.py +++ b/homeassistant/components/__init__.py @@ -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' diff --git a/homeassistant/components/http/frontend.py b/homeassistant/components/http/frontend.py index d18a0bc1915..600b21cf8d7 100644 --- a/homeassistant/components/http/frontend.py +++ b/homeassistant/components/http/frontend.py @@ -1,2 +1,2 @@ """ DO NOT MODIFY. Auto-generated by build_frontend script """ -VERSION = "6d353f9599942124690691fb22c115ee" +VERSION = "eed02673a7e36fe85f2fa021373d0156" diff --git a/homeassistant/components/http/www_static/frontend.html b/homeassistant/components/http/www_static/frontend.html index c06ced766e1..6eedd9f4040 100644 --- a/homeassistant/components/http/www_static/frontend.html +++ b/homeassistant/components/http/www_static/frontend.html @@ -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; + } } }, diff --git a/homeassistant/components/http/www_static/polymer/home-assistant-api.html b/homeassistant/components/http/www_static/polymer/home-assistant-api.html index 6d1713d2777..67adc93efbb 100644 --- a/homeassistant/components/http/www_static/polymer/home-assistant-api.html +++ b/homeassistant/components/http/www_static/polymer/home-assistant-api.html @@ -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; + } } },