diff --git a/homeassistant/components/__init__.py b/homeassistant/components/__init__.py index 663393f9c15e48..063f5e01939315 100644 --- a/homeassistant/components/__init__.py +++ b/homeassistant/components/__init__.py @@ -31,6 +31,9 @@ # 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 d18a0bc1915127..600b21cf8d765c 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 c06ced766e1d90..6eedd9f4040033 100644 --- a/homeassistant/components/http/www_static/frontend.html +++ b/homeassistant/components/http/www_static/frontend.html @@ -20048,7 +20048,12 @@

{{heading}}

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 6d1713d2777084..67adc93efbb322 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; + } } },