Merge pull request #100 from balloob/dev

Update master with latest changes
This commit is contained in:
Paulus Schoutsen committed 2015-04-24 21:02:14 -07:00
commit 31a22d4c6a
35 files changed
+1605 -336

No files matched your search

+6
View File
@@ -28,6 +28,12 @@ omit =
homeassistant/components/device_tracker/netgear.py
homeassistant/components/device_tracker/nmap_tracker.py
homeassistant/components/device_tracker/ddwrt.py
homeassistant/components/sensor/transmission.py
homeassistant/components/isy994.py
homeassistant/components/light/isy994.py
homeassistant/components/switch/isy994.py
homeassistant/components/sensor/isy994.py
[report]
+14
View File
@@ -27,9 +27,23 @@ A state can have several attributes that will help the frontend in displaying yo
- `friendly_name`: this name will be used as the name of the device
- `entity_picture`: this picture will be shown instead of the domain icon
- `unit_of_measurement`: this will be appended to the state in the interface
- `hidden`: This is a suggestion to the frontend on if the state should be hidden
These attributes are defined in [homeassistant.components](https://github.com/balloob/home-assistant/blob/master/homeassistant/components/__init__.py#L25).
## Proper Visibility Handling ##
Generally, when creating a new entity for Home Assistant you will want it to be a class that inherits the [homeassistant.helpers.entity.Entity](https://github.com/balloob/home-assistant/blob/master/homeassistant/helpers/entity.py) Class. If this is done, visibility will be handled for you.
You can set a suggestion for your entity's visibility by setting the hidden property by doing something similar to the following.
```python
self.hidden = True
```
This will SUGGEST that the active frontend hides the entity. This requires that the active frontend support hidden cards (the default frontend does) and that the value of hidden be included in your attributes dictionary (see above). The Entity abstract class will take care of this for you.
Remember: The suggestion set by your component's code will always be overwritten by user settings in the configuration.yaml file. This is why you may set hidden to be False, but the property may remain True (or vice-versa).
## Working on the frontend
The frontend is composed of Polymer web-components and compiled into the file `frontend.html`. During development you do not want to work with the compiled version but with the seperate files. To have Home Assistant serve the seperate files, set `development=1` for the http-component in your config.
+2 -1
View File
@@ -907,7 +907,8 @@ class Config(object):
_LOGGER.info('Auto detecting location and temperature unit')
try:
info = requests.get('https://freegeoip.net/json/').json()
info = requests.get(
'https://freegeoip.net/json/', timeout=5).json()
except requests.RequestException:
return
+1
View File
@@ -85,6 +85,7 @@ def ensure_config_path(config_dir):
conf.write("frontend:\n\n")
conf.write("discovery:\n\n")
conf.write("history:\n\n")
conf.write("logbook:\n\n")
except IOError:
print(('Fatal Error: No configuration file found and unable '
'to write a default one to {}').format(config_path))
+6 -2
View File
@@ -20,10 +20,11 @@ import homeassistant
import homeassistant.loader as loader
import homeassistant.components as core_components
import homeassistant.components.group as group
from homeassistant.helpers.entity import Entity
from homeassistant.const import (
EVENT_COMPONENT_LOADED, CONF_LATITUDE, CONF_LONGITUDE,
CONF_TEMPERATURE_UNIT, CONF_NAME, CONF_TIME_ZONE, TEMP_CELCIUS,
TEMP_FAHRENHEIT)
CONF_TEMPERATURE_UNIT, CONF_NAME, CONF_TIME_ZONE, CONF_VISIBILITY,
TEMP_CELCIUS, TEMP_FAHRENHEIT)
_LOGGER = logging.getLogger(__name__)
@@ -207,6 +208,9 @@ def process_ha_core_config(hass, config):
if key in config:
setattr(hass.config, attr, config[key])
for entity_id, hidden in config.get(CONF_VISIBILITY, {}).items():
Entity.overwrite_hidden(entity_id, hidden == 'hide')
if CONF_TEMPERATURE_UNIT in config:
unit = config[CONF_TEMPERATURE_UNIT]
@@ -15,8 +15,8 @@
<link rel='shortcut icon' href='/static/favicon.ico' />
<link rel='icon' type='image/png'
href='/static/favicon-192x192.png' sizes='192x192'>
<link rel='apple-touch-icon' sizes='180x180'
href='/apple-icon-180x180.png'>
<link rel='apple-touch-icon' sizes='192x192'
href='/static/favicon-192x192.png'>
<meta name='theme-color' content='#03a9f4'>
</head>
<body fullbleed>
+1 -1
View File
@@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "1e004712440afc642a44ad927559587e"
VERSION = "93774c7a1643c7e3f9cbbb1554b36683"
@@ -1,257 +1,21 @@
<div hidden><style shim-shadowdom="">html /deep/ [layout][horizontal],html /deep/ [layout][vertical]{display:-ms-flexbox;display:-webkit-flex;display:flex}html /deep/ [layout][horizontal][inline],html /deep/ [layout][vertical][inline]{display:-ms-inline-flexbox;display:-webkit-inline-flex;display:inline-flex}html /deep/ [layout][horizontal]{-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row}html /deep/ [layout][horizontal][reverse]{-ms-flex-direction:row-reverse;-webkit-flex-direction:row-reverse;flex-direction:row-reverse}html /deep/ [layout][vertical]{-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}html /deep/ [layout][vertical][reverse]{-ms-flex-direction:column-reverse;-webkit-flex-direction:column-reverse;flex-direction:column-reverse}html /deep/ [layout][wrap]{-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap}html /deep/ [layout][wrap-reverse]{-ms-flex-wrap:wrap-reverse;-webkit-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse}html /deep/ [flex]{-ms-flex:1 1 0;-webkit-flex:1;flex:1;-webkit-flex-basis:0;flex-basis:0}html /deep/ [vertical][layout]>[flex][auto-vertical],html /deep/ [vertical][layout]::shadow [flex][auto-vertical]{-ms-flex:1 1 auto;-webkit-flex-basis:auto;flex-basis:auto}html /deep/ [flex][auto]{-ms-flex:1 1 auto;-webkit-flex-basis:auto;flex-basis:auto}html /deep/ [flex][none]{-ms-flex:none;-webkit-flex:none;flex:none}html /deep/ [flex][one]{-ms-flex:1;-webkit-flex:1;flex:1}html /deep/ [flex][two]{-ms-flex:2;-webkit-flex:2;flex:2}html /deep/ [flex][three]{-ms-flex:3;-webkit-flex:3;flex:3}html /deep/ [flex][four]{-ms-flex:4;-webkit-flex:4;flex:4}html /deep/ [flex][five]{-ms-flex:5;-webkit-flex:5;flex:5}html /deep/ [flex][six]{-ms-flex:6;-webkit-flex:6;flex:6}html /deep/ [flex][seven]{-ms-flex:7;-webkit-flex:7;flex:7}html /deep/ [flex][eight]{-ms-flex:8;-webkit-flex:8;flex:8}html /deep/ [flex][nine]{-ms-flex:9;-webkit-flex:9;flex:9}html /deep/ [flex][ten]{-ms-flex:10;-webkit-flex:10;flex:10}html /deep/ [flex][eleven]{-ms-flex:11;-webkit-flex:11;flex:11}html /deep/ [flex][twelve]{-ms-flex:12;-webkit-flex:12;flex:12}html /deep/ [layout][start]{-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}html /deep/ [layout][center],html /deep/ [layout][center-center]{-ms-flex-align:center;-webkit-align-items:center;align-items:center}html /deep/ [layout][end]{-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end}html /deep/ [layout][start-justified]{-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}html /deep/ [layout][center-justified],html /deep/ [layout][center-center]{-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}html /deep/ [layout][end-justified]{-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}html /deep/ [layout][around-justified]{-ms-flex-pack:distribute;-webkit-justify-content:space-around;justify-content:space-around}html /deep/ [layout][justified]{-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}html /deep/ [self-start]{-ms-align-self:flex-start;-webkit-align-self:flex-start;align-self:flex-start}html /deep/ [self-center]{-ms-align-self:center;-webkit-align-self:center;align-self:center}html /deep/ [self-end]{-ms-align-self:flex-end;-webkit-align-self:flex-end;align-self:flex-end}html /deep/ [self-stretch]{-ms-align-self:stretch;-webkit-align-self:stretch;align-self:stretch}html /deep/ [block]{display:block}html /deep/ [hidden]{display:none!important}html /deep/ [relative]{position:relative}html /deep/ [fit]{position:absolute;top:0;right:0;bottom:0;left:0}body[fullbleed]{margin:0;height:100vh}html /deep/ [segment],html /deep/ segment{display:block;position:relative;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;margin:1em .5em;padding:1em;background-color:#fff;-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(0,0,0,.1);border-radius:5px 5px 5px 5px}</style><script>window.PolymerGestures={},function(a){var b=!1,c=document.createElement("meta");if(c.createShadowRoot){var d=c.createShadowRoot(),e=document.createElement("span");d.appendChild(e),c.addEventListener("testpath",function(a){a.path&&(b=a.path[0]===e),a.stopPropagation()});var f=new CustomEvent("testpath",{bubbles:!0});document.head.appendChild(c),e.dispatchEvent(f),c.parentNode.removeChild(c),d=e=null}c=null;var g={shadow:function(a){return a?a.shadowRoot||a.webkitShadowRoot:void 0},canTarget:function(a){return a&&Boolean(a.elementFromPoint)},targetingShadow:function(a){var b=this.shadow(a);return this.canTarget(b)?b:void 0},olderShadow:function(a){var b=a.olderShadowRoot;if(!b){var c=a.querySelector("shadow");c&&(b=c.olderShadowRoot)}return b},allShadows:function(a){for(var b=[],c=this.shadow(a);c;)b.push(c),c=this.olderShadow(c);return b},searchRoot:function(a,b,c){var d,e;return a?(d=a.elementFromPoint(b,c),d?e=this.targetingShadow(d):a!==document&&(e=this.olderShaLine truncated
var ab=H,bb=L;a.esprima={parse:R}}(this),function(a){"use strict";function b(a,b,d,e){var f;try{if(f=c(a),f.scopeIdent&&(d.nodeType!==Node.ELEMENT_NODE||"TEMPLATE"!==d.tagName||"bind"!==b&&"repeat"!==b))throw Error("as and in can only be used within <template bind/repeat>")}catch(g){return void console.error("Invalid expression syntax: "+a,g)}return function(a,b,c){var d=f.getBinding(a,e,c);return f.scopeIdent&&d&&(b.polymerExpressionScopeIdent_=f.scopeIdent,f.indexIdent&&(b.polymerExpressionIndexIdent_=f.indexIdent)),d}}function c(a){var b=q[a];if(!b){var c=new j;esprima.parse(a,c),b=new l(c),q[a]=b}return b}function d(a){this.value=a,this.valueFn_=void 0}function e(a){this.name=a,this.path=Path.get(a)}function f(a,b,c){this.computed="["==c,this.dynamicDeps="function"==typeof a||a.dynamicDeps||this.computed&&!(b instanceof d),this.simplePath=!this.dynamicDeps&&(b instanceof e||b instanceof d)&&(a instanceof f||a instanceof e),this.object=this.simplePath?a:i(a),this.property=!this.computed||this.simplePath?b:i(b)}function g(a,b){this.name=a,this.args=[];for(var c=0;c<b.length;c++)this.args[c]=i(b[c])}function h(){throw Error("Not Implemented")}function i(a){return"function"==typeof a?a:a.valueFn()}function j(){this.expression=null,this.filters=[],this.deps={},this.currentPath=void 0,this.scopeIdent=void 0,this.indexIdent=void 0,this.dynamicDeps=!1}function k(a){this.value_=a}function l(a){if(this.scopeIdent=a.scopeIdent,this.indexIdent=a.indexIdent,!a.expression)throw Error("No expression found.");this.expression=a.expression,i(this.expression),this.filters=a.filters,this.dynamicDeps=a.dynamicDeps}function m(a){return String(a).replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()})}function n(a,b){for(;a[t]&&!Object.prototype.hasOwnProperty.call(a,b);)a=a[t];return a}function o(a){switch(a){case"":return!1;case"false":case"null":case"true":return!0}return isNaN(Number(a))?!1:!0}function p(){}var q=Object.create(null);d.prototype={valueFn:function(){if(!this.valueFn_){var a=this.value;this.valueFn_=function(){return a}}return this.valueFn_}},e.prototype={valueFn:function(){if(!this.valueFn_){var a=(this.name,this.path);this.valueFn_=function(b,c){return c&&c.addPath(b,a),a.getValueFrom(b)}}return this.valueFn_},setValue:function(a,b){return 1==this.path.length&&(a=n(a,this.path[0])),this.path.setValueFrom(a,b)}},f.prototype={get fullPath(){if(!this.fullPath_){var a=this.object instanceof f?this.object.fullPath.slice():[this.object.name];a.push(this.property instanceof e?this.property.name:this.property.value),this.fullPath_=Path.get(a)}return this.fullPath_},valueFn:function(){if(!this.valueFn_){var a=this.object;if(this.simplePath){var b=this.fullPath;this.valueFn_=function(a,c){return c&&c.addPath(a,b),b.getValueFrom(a)}}else if(this.computed){var c=this.property;this.valueFn_=function(b,d,e){var f=a(b,d,e),g=c(b,d,e);return d&&d.addPath(f,[g]),f?f[g]:void 0}}else{var b=Path.get(this.property.name);this.valueFn_=function(c,d,e){var f=a(c,d,e);return d&&d.addPath(f,b),b.getValueFrom(f)}}}return this.valueFn_},setValue:function(a,b){if(this.simplePath)return this.fullPath.setValueFrom(a,b),b;var c=this.object(a),d=this.property instanceof e?this.property.name:this.property(a);return c[d]=b}},g.prototype={transform:function(a,b,c,d,e){var f=c[this.name],g=a;if(f)g=void 0;else if(f=g[this.name],!f)return void console.error("Cannot find function or filter: "+this.name);if(d?f=f.toModel:"function"==typeof f.toDOM&&(f=f.toDOM),"function"!=typeof f)return void console.error("Cannot find function or filter: "+this.name);for(var h=e||[],j=0;j<this.args.length;j++)h.push(i(this.args[j])(a,b,c));return f.apply(g,h)}};var r={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},s={"+":function(a,b){return a+b},"-":function(a,b){return a-b},"*":function(a,b){return a*b},"/":function(a,b){return a/b},"%":function(a,b){return a%b},"<":function(a,b){return b>a},">":function(a,b){return a>b},"<=":function(a,b){return b>=a},">=":function(a,b){return a>=b},"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"===":function(a,b){return a===b},"!==":function(a,b){return a!==b},"&&":function(a,b){return a&&b},"||":function(a,b){return a||b}};j.prototype={createUnaryExpression:function(a,b){if(!r[a])throw Error("Disallowed operator: "+a);return b=i(b),function(c,d,e){return r[a](b(c,d,e))}},createBinaryExpression:function(a,b,c){if(!s[a])throw Error("Disallowed operator: "+a);switch(b=i(b),c=i(c),a){case"||":return this.dynamicDeps=!0,function(a,d,e){return b(a,d,e)||c(a,d,e)};case"&&":return this.dynamicDeps=!0,function(a,d,e){return b(a,d,e)&&c(a,d,e)}}return function(d,e,f){return s[a](b(d,e,f),c(d,e,f))}},createConditionalExpression:function(a,b,c){return a=i(a),b=i(b),c=i(c),this.dynamicDeps=!0,function(d,e,f){return a(d,e,f)?b(d,e,f):c(d,e,f)}},createIdentifier:function(a){var b=new e(a);return b.type="Identifier",b},createMemberExpression:function(a,b,c){var d=new f(b,c,a);return d.dyLine truncated
},HTMLSelectElement.prototype.bind=function(a,c,d){if("selectedindex"===a&&(a="selectedIndex"),"selectedIndex"!==a&&"value"!==a)return HTMLElement.prototype.bind.call(this,a,c,d);if(this.removeAttribute(a),d)return j(this,a,c);var e=c,f=m(this,a,e);return j(this,a,e.open(k(this,a))),b(this,a,f)}}(this),function(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a){for(var b;b=a.parentNode;)a=b;return a}function d(a,b){if(b){for(var d,e="#"+b;!d&&(a=c(a),a.protoContent_?d=a.protoContent_.querySelector(e):a.getElementById&&(d=a.getElementById(b)),!d&&a.templateCreator_);)a=a.templateCreator_;return d}}function e(a){return"template"==a.tagName&&"http://www.w3.org/2000/svg"==a.namespaceURI}function f(a){return"TEMPLATE"==a.tagName&&"http://www.w3.org/1999/xhtml"==a.namespaceURI}function g(a){return Boolean(L[a.tagName]&&a.hasAttribute("template"))}function h(a){return void 0===a.isTemplate_&&(a.isTemplate_="TEMPLATE"==a.tagName||g(a)),a.isTemplate_}function i(a,b){var c=a.querySelectorAll(N);h(a)&&b(a),G(c,b)}function j(a){function b(a){HTMLTemplateElement.decorate(a)||j(a.content)}i(a,b)}function k(a,b){Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))})}function l(a){var b=a.ownerDocument;if(!b.defaultView)return b;var c=b.templateContentsOwner_;if(!c){for(c=b.implementation.createHTMLDocument("");c.lastChild;)c.removeChild(c.lastChild);b.templateContentsOwner_=c}return c}function m(a){if(!a.stagingDocument_){var b=a.ownerDocument;if(!b.stagingDocument_){b.stagingDocument_=b.implementation.createHTMLDocument(""),b.stagingDocument_.isStagingDocument=!0;var c=b.stagingDocument_.createElement("base");c.href=document.baseURI,b.stagingDocument_.head.appendChild(c),b.stagingDocument_.stagingDocument_=b.stagingDocument_}a.stagingDocument_=b.stagingDocument_}return a.stagingDocument_}function n(a){var b=a.ownerDocument.createElement("template");a.parentNode.insertBefore(b,a);for(var c=a.attributes,d=c.length;d-->0;){var e=c[d];K[e.name]&&("template"!==e.name&&b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function o(a){var b=a.ownerDocument.createElement("template");a.parentNode.insertBefore(b,a);for(var c=a.attributes,d=c.length;d-->0;){var e=c[d];b.setAttribute(e.name,e.value),a.removeAttribute(e.name)}return a.parentNode.removeChild(a),b}function p(a,b,c){var d=a.content;if(c)return void d.appendChild(b);for(var e;e=b.firstChild;)d.appendChild(e)}function q(a){P?a.__proto__=HTMLTemplateElement.prototype:k(a,HTMLTemplateElement.prototype)}function r(a){a.setModelFn_||(a.setModelFn_=function(){a.setModelFnScheduled_=!1;var b=z(a,a.delegate_&&a.delegate_.prepareBinding);w(a,b,a.model_)}),a.setModelFnScheduled_||(a.setModelFnScheduled_=!0,Observer.runEOM_(a.setModelFn_))}function s(a,b,c,d){if(a&&a.length){for(var e,f=a.length,g=0,h=0,i=0,j=!0;f>h;){var g=a.indexOf("{{",h),k=a.indexOf("[[",h),l=!1,m="}}";if(k>=0&&(0>g||g>k)&&(g=k,l=!0,m="]]"),i=0>g?-1:a.indexOf(m,g+2),0>i){if(!e)return;e.push(a.slice(h));break}e=e||[],e.push(a.slice(h,g));var n=a.slice(g+2,i).trim();e.push(l),j=j&&l;var o=d&&d(n,b,c);e.push(null==o?Path.get(n):null),e.push(o),h=i+2}return h===f&&e.push(""),e.hasOnePath=5===e.length,e.isSimplePath=e.hasOnePath&&""==e[0]&&""==e[4],e.onlyOneTime=j,e.combinator=function(a){for(var b=e[0],c=1;c<e.length;c+=4){var d=e.hasOnePath?a:a[(c-1)/4];void 0!==d&&(b+=d),b+=e[c+3]}return b},e}}function t(a,b,c,d){if(b.hasOnePath){var e=b[3],f=e?e(d,c,!0):b[2].getValueFrom(d);return b.isSimplePath?f:b.combinator(f)}for(var g=[],h=1;h<b.length;h+=4){var e=b[h+2];g[(h-1)/4]=e?e(d,c):b[h+1].getValueFrom(d)}return b.combinator(g)}function u(a,b,c,d){var e=b[3],f=e?e(d,c,!1):new PathObserver(d,b[2]);return b.isSimplePath?f:new ObserverTransform(f,b.combinator)}function v(a,b,c,d){if(b.onlyOneTime)return t(a,b,c,d);if(b.hasOnePath)return u(a,b,c,d);for(var e=new CompoundObserver,f=1;f<b.length;f+=4){var g=b[f],h=b[f+2];if(h){var i=h(d,c,g);g?e.addPath(i):e.addObserver(i)}else{var j=b[f+1];g?e.addPath(j.getValueFrom(d)):e.addPath(d,j)}}return new ObserverTransform(e,b.combinator)}function w(a,b,c,d){for(var e=0;e<b.length;e+=2){var f=b[e],g=b[e+1],h=v(f,g,a,c),i=a.bind(f,h,g.onlyOneTime);i&&d&&d.push(i)}if(a.bindFinished(),b.isTemplate){a.model_=c;var j=a.processBindingDirectives_(b);d&&j&&d.push(j)}}function x(a,b,c){var d=a.getAttribute(b);return s(""==d?"{{}}":d,b,a,c)}function y(a,c){b(a);for(var d=[],e=0;e<a.attributes.length;e++){for(var f=a.attributes[e],g=f.name,i=f.value;"_"===g[0];)g=g.substring(1);if(!h(a)||g!==J&&g!==H&&g!==I){var j=s(i,g,a,c);j&&d.push(g,j)}}return h(a)&&(d.isTemplate=!0,d["if"]=x(a,J,c),d.bind=x(a,H,c),d.repeat=x(a,I,c),!d["if"]||d.bind||d.repeat||(d.bind=s("{{}}",H,a,c))),d}function z(a,b){if(a.nodeType===Node.ELEMENT_NODE)return y(a,b);if(a.nodeType===Node.TEXT_NODE){var c=s(a.data,"textContent",a,b);if(c)return["textContent",c]}return[]}function A(a,b,c,d,e,f,g){for(var h=b.appLine truncated
b.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.localName,a);for(var c in a){var d=a[c];PolymerGestures.addEventListener(this,c,this.element.getEventHandler(this,this,d))}},dispatchMethod:function(a,c,d){if(a){b.events&&console.group("[%s] dispatch [%s]",a.localName,c);var e="function"==typeof c?c:a[c];e&&e[d?"apply":"call"](a,d),b.events&&console.groupEnd(),Polymer.flush()}}};a.api.instance.events=d,a.addEventListener=function(a,b,c,d){PolymerGestures.addEventListener(wrap(a),b,c,d)},a.removeEventListener=function(a,b,c,d){PolymerGestures.removeEventListener(wrap(a),b,c,d)}}(Polymer),function(a){var b={copyInstanceAttributes:function(){var a=this._instanceAttributes;for(var b in a)this.hasAttribute(b)||this.setAttribute(b,a[b])},takeAttributes:function(){if(this._publishLC)for(var a,b=0,c=this.attributes,d=c.length;(a=c[b])&&d>b;b++)this.attributeToProperty(a.name,a.value)},attributeToProperty:function(b,c){var b=this.propertyForAttribute(b);if(b){if(c&&c.search(a.bindPattern)>=0)return;var d=this[b],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:function(a){var b=this._publishLC&&this._publishLC[a];return b},deserializeValue:function(b,c){return a.deserializeValue(b,c)},serializeValue:function(a,b){return"boolean"===b?a?"":void 0:"object"!==b&&"function"!==b&&void 0!==a?a:void 0},reflectPropertyToAttribute:function(a){var b=typeof this[a],c=this.serializeValue(this[a],b);void 0!==c?this.setAttribute(a,c):"boolean"===b&&this.removeAttribute(a)}};a.api.instance.attributes=b}(Polymer),function(a){function b(a,b){return a===b?0!==a||1/a===1/b:f(a)&&f(b)?!0:a!==a&&b!==b}function c(a,b){return void 0===b&&null===a?b:null===b||void 0===b?a:b}var d=window.WebComponents?WebComponents.flags.log:{},e={object:void 0,type:"update",name:void 0,oldValue:void 0},f=Number.isNaN||function(a){return"number"==typeof a&&isNaN(a)},g={createPropertyObserver:function(){var a=this._observeNames;if(a&&a.length){var b=this._propertyObserver=new CompoundObserver(!0);this.registerObserver(b);for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)b.addPath(this,c),this.observeArrayValue(c,this[c],null)}},openPropertyObserver:function(){this._propertyObserver&&this._propertyObserver.open(this.notifyPropertyChanges,this)},notifyPropertyChanges:function(a,b,c){var d,e,f={};for(var g in b)if(d=c[2*g+1],e=this.observe[d]){var h=b[g],i=a[g];this.observeArrayValue(d,i,h),f[e]||(void 0!==h&&null!==h||void 0!==i&&null!==i)&&(f[e]=!0,this.invokeMethod(e,[h,i,arguments]))}},invokeMethod:function(a,b){var c=this[a]||a;"function"==typeof c&&c.apply(this,b)},deliverChanges:function(){this._propertyObserver&&this._propertyObserver.deliver()},observeArrayValue:function(a,b,c){var e=this.observe[a];if(e&&(Array.isArray(c)&&(d.observe&&console.log("[%s] observeArrayValue: unregister observer [%s]",this.localName,a),this.closeNamedObserver(a+"__array")),Array.isArray(b))){d.observe&&console.log("[%s] observeArrayValue: register observer [%s]",this.localName,a,b);var f=new ArrayObserver(b);f.open(function(a){this.invokeMethod(e,[a])},this),this.registerNamedObserver(a+"__array",f)}},emitPropertyChangeRecord:function(a,c,d){if(!b(c,d)&&(this._propertyChanged(a,c,d),Observer.hasObjectObserve)){var f=this._objectNotifier;f||(f=this._objectNotifier=Object.getNotifier(this)),e.object=this,e.name=a,e.oldValue=d,f.notify(e)}},_propertyChanged:function(a){this.reflect[a]&&this.reflectPropertyToAttribute(a)},bindProperty:function(a,b,d){if(d)return void(this[a]=b);var e=this.element.prototype.computed;if(e&&e[a]){var f=a+"ComputedBoundObservable_";return void(this[f]=b)}return this.bindToAccessor(a,b,c)},bindToAccessor:function(a,c,d){function e(b,c){j[f]=b;var d=j[h];d&&"function"==typeof d.setValue&&d.setValue(b),j.emitPropertyChangeRecord(a,b,c)}var f=a+"_",g=a+"Observable_",h=a+"ComputedBoundObservable_";this[g]=c;var i=this[f],j=this,k=c.open(e);if(d&&!b(i,k)){var l=d(i,k);b(k,l)||(k=l,c.setValue&&c.setValue(k))}e(k,i);var m={close:function(){c.close(),j[g]=void 0,j[h]=void 0}};return this.registerObserver(m),m},createComputedProperties:function(){if(this._computedNames)for(var a=0;a<this._computedNames.length;a++){var b=this._computedNames[a],c=this.computed[b];try{var d=PolymerExpressions.getExpression(c),e=d.getBinding(this,this.element.syntax);this.bindToAccessor(b,e)}catch(f){console.error("Failed to create computed property",f)}}},registerObserver:function(a){return this._observers?void this._observers.push(a):void(this._observers=[a])},closeObservers:function(){if(this._observers){for(var a=this._observers,b=0;b<a.length;b++){var c=a[b];c&&"function"==typeof c.close&&c.close()}this._observers=[]}},registerNamedObserver:function(a,b){var c=this._namedObservers||(this._namedObservers={});c[a]=b},closeNamedObserver:function(a){var b=this._namedObservers;return b&&b[a]?(b[a].close(),b[a]=null,!0):void 0},closeNamedObservers:function(){if(this._namedObservers){for(var a in this._namedObservers)this.closeNamedObservLine truncated
<div hidden><link href="//fonts.googleapis.com/css?family=RobotoDraft:regular,bold,italic,thin,light,bolditalic,black,medium&amp;lang=en" rel="stylesheet" type="text/css"></div>
<html><head><style shim-shadowdom="">html /deep/ [layout][horizontal], html /deep/ [layout][vertical] { display: -ms-flexbox; display: -webkit-flex; display: flex;}html /deep/ [layout][horizontal][inline], html /deep/ [layout][vertical][inline] { display: -ms-inline-flexbox; display: -webkit-inline-flex; display: inline-flex;}html /deep/ [layout][horizontal] { -ms-flex-direction: row; -webkit-flex-direction: row; flex-direction: row;}html /deep/ [layout][horizontal][reverse] { -ms-flex-direction: row-reverse; -webkit-flex-direction: row-reverse; flex-direction: row-reverse;}html /deep/ [layout][vertical] { -ms-flex-direction: column; -webkit-flex-direction: column; flex-direction: column;}html /deep/ [layout][vertical][reverse] { -ms-flex-direction: column-reverse; -webkit-flex-direction: column-reverse; flex-direction: column-reverse;}html /deep/ [layout][wrap] { -ms-flex-wrap: wrap; -webkit-flex-wrap: wrap; flex-wrap: wrap;}html /deep/ [layout][wrap-reverse] { -ms-flex-wrap: wrap-reverse; -webkit-flex-wrap: wrap-reverse; flex-wrap: wrap-reverse;}html /deep/ [flex] { -ms-flex: 1 1 0.000000001px; -webkit-flex: 1; flex: 1; -webkit-flex-basis: 0.000000001px; flex-basis: 0.000000001px;}html /deep/ [vertical][layout] > [flex][auto-vertical], html /deep/ [vertical][layout]::shadow [flex][auto-vertical] { -ms-flex: 1 1 auto; -webkit-flex-basis: auto; flex-basis: auto;}html /deep/ [flex][auto] { -ms-flex: 1 1 auto; -webkit-flex-basis: auto; flex-basis: auto;}html /deep/ [flex][none] { -ms-flex: none; -webkit-flex: none; flex: none;}html /deep/ [flex][one] { -ms-flex: 1; -webkit-flex: 1; flex: 1;}html /deep/ [flex][two] { -ms-flex: 2; -webkit-flex: 2; flex: 2;}html /deep/ [flex][three] { -ms-flex: 3; -webkit-flex: 3; flex: 3;}html /deep/ [flex][four] { -ms-flex: 4; -webkit-flex: 4; flex: 4;}html /deep/ [flex][five] { -ms-flex: 5; -webkit-flex: 5; flex: 5;}html /deep/ [flex][six] { -ms-flex: 6; -webkit-flex: 6; flex: 6;}html /deep/ [flex][seven] { -ms-flex: 7; -webkit-flex: 7; flex: 7;}html /deep/ [flex][eight] { -ms-flex: 8; -webkit-flex: 8; flex: 8;}html /deep/ [flex][nine] { -ms-flex: 9; -webkit-flex: 9; flex: 9;}html /deep/ [flex][ten] { -ms-flex: 10; -webkit-flex: 10; flex: 10;}html /deep/ [flex][eleven] { -ms-flex: 11; -webkit-flex: 11; flex: 11;}html /deep/ [flex][twelve] { -ms-flex: 12; -webkit-flex: 12; flex: 12;}html /deep/ [layout][start] { -ms-flex-align: start; -webkit-align-items: flex-start; align-items: flex-start;}html /deep/ [layout][center], html /deep/ [layout][center-center] { -ms-flex-align: center; -webkit-align-items: center; align-items: center;}html /deep/ [layout][end] { -ms-flex-align: end; -webkit-align-items: flex-end; align-items: flex-end;}html /deep/ [layout][start-justified] { -ms-flex-pack: start; -webkit-justify-content: flex-start; justify-content: flex-start;}html /deep/ [layout][center-justified], html /deep/ [layout][center-center] { -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center;}html /deep/ [layout][end-justified] { -ms-flex-pack: end; -webkit-justify-content: flex-end; justify-content: flex-end;}html /deep/ [layout][around-justified] { -ms-flex-pack: distribute; -webkit-justify-content: space-around; justify-content: space-around;}html /deep/ [layout][justified] { -ms-flex-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;}html /deep/ [self-start] { -ms-align-self: flex-start; -webkit-align-self: flex-start; align-self: flex-start;}html /deep/ [self-center] { -ms-align-self: center; -webkit-align-self: center; align-self: center;}html /deep/ [self-end] { -ms-align-self: flex-end; -webkit-align-self: flex-end; align-self: flex-end;}html /deep/ [self-stretch] { -ms-align-self: stretch; -webkit-align-self: stretch; align-self: stretch;}html /deep/ [block] { display: block;}html /deep/ [hidden] { display: none !important;}html /deep/ [relative] { position: relative;}html /deep/ [fit] { position: absolute; top: 0; right: 0; bottom: 0; left: 0;}body[fullbleed] { margin: 0; height: 100vh;}html /deep/ [segment], html /deep/ segment { display: block; position: relative; -webkit-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; margin: 1em 0.5em; padding: 1em; background-color: white; -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1); box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1); border-radius: 5px 5px 5px 5px;}</style> <script>/**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
window.PolymerGestures={},function(a){var b=!1,c=document.createElement("meta");if(c.createShadowRoot){var d=c.createShadowRoot(),e=document.createElement("span");d.appendChild(e),c.addEventListener("testpath",function(a){a.path&&(b=a.path[0]===e),a.stopPropagation()});var f=new CustomEvent("testpath",{bubbles:!0});document.head.appendChild(c),e.dispatchEvent(f),c.parentNode.removeChild(c),d=e=null}c=null;var g={shadow:function(a){return a?a.shadowRoot||a.webkitShadowRoot:void 0},canTarget:function(a){return a&&Boolean(a.elementFromPoint)},targetingShadow:function(a){var b=this.shadow(a);return this.canTarget(b)?b:void 0},olderShadow:function(a){var b=a.olderShadowRoot;if(!b){var c=a.querySelector("shadow");c&&(b=c.olderShadowRoot)}return b},allShadows:function(a){for(var b=[],c=this.shadow(a);c;)b.push(c),c=this.olderShadow(c);return b},searchRoot:function(a,b,c){var d,e;return a?(d=a.elementFromPoint(b,c),d?e=this.targetingShadow(d):a!==document&&(e=this.olderShadow(a)),this.searchRoot(e,b,c)||d):void 0},owner:function(a){if(!a)return document;for(var b=a;b.parentNode;)b=b.parentNode;return b.nodeType!=Node.DOCUMENT_NODE&&b.nodeType!=Node.DOCUMENT_FRAGMENT_NODE&&(b=document),b},findTarget:function(a){if(b&&a.path&&a.path.length)return a.path[0];var c=a.clientX,d=a.clientY,e=this.owner(a.target);return e.elementFromPoint(c,d)||(e=document),this.searchRoot(e,c,d)},findTouchAction:function(a){var c;if(b&&a.path&&a.path.length){for(var d=a.path,e=0;e<d.length;e++)if(c=d[e],c.nodeType===Node.ELEMENT_NODE&&c.hasAttribute("touch-action"))return c.getAttribute("touch-action")}else for(c=a.target;c;){if(c.nodeType===Node.ELEMENT_NODE&&c.hasAttribute("touch-action"))return c.getAttribute("touch-action");c=c.parentNode||c.host}return"auto"},LCA:function(a,b){if(a===b)return a;if(a&&!b)return a;if(b&&!a)return b;if(!b&&!a)return document;if(a.contains&&a.contains(b))return a;if(b.contains&&b.contains(a))return b;var c=this.depth(a),d=this.depth(b),e=c-d;for(e>=0?a=this.walk(a,e):b=this.walk(b,-e);a&&b&&a!==b;)a=a.parentNode||a.host,b=b.parentNode||b.host;return a},walk:function(a,b){for(var c=0;a&&b>c;c++)a=a.parentNode||a.host;return a},depth:function(a){for(var b=0;a;)b++,a=a.parentNode||a.host;return b},deepContains:function(a,b){var c=this.LCA(a,b);return c===a},insideNode:function(a,b,c){var d=a.getBoundingClientRect();return d.left<=b&&b<=d.right&&d.top<=c&&c<=d.bottom},path:function(a){var c;if(b&&a.path&&a.path.length)c=a.path;else{c=[];for(var d=this.findTarget(a);d;)c.push(d),d=d.parentNode||d.host}return c}};a.targetFinding=g,a.findTarget=g.findTarget.bind(g),a.deepContains=g.deepContains.bind(g),a.insideNode=g.insideNode}(window.PolymerGestures),function(){function a(a){return"html /deep/ "+b(a)}function b(a){return'[touch-action="'+a+'"]'}function c(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+";}"}var d=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]},"manipulation"],e="",f="string"==typeof document.head.style.touchAction,g=!window.ShadowDOMPolyfill&&document.head.createShadowRoot;if(f){d.forEach(function(d){String(d)===d?(e+=b(d)+c(d)+"\n",g&&(e+=a(d)+c(d)+"\n")):(e+=d.selectors.map(b)+c(d.rule)+"\n",g&&(e+=d.selectors.map(a)+c(d.rule)+"\n"))});var h=document.createElement("style");h.textContent=e,document.head.appendChild(h)}}(),function(a){var b=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","pageX","pageY"],c=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0],d=function(){return function(){}},e={preventTap:d,makeBaseEvent:function(a,b){var c=document.createEvent("Event");return c.initEvent(a,b.bubbles||!1,b.cancelable||!1),c.preventTap=e.preventTap(c),c},makeGestureEvent:function(a,b){b=b||Object.create(null);for(var c,d=this.makeBaseEvent(a,b),e=0,f=Object.keys(b);e<f.length;e++)c=f[e],"bubbles"!==c&&"cancelable"!==c&&(d[c]=b[c]);return d},makePointerEvent:function(a,d){d=d||Object.create(null);for(var e,f=this.makeBaseEvent(a,d),g=2;g<b.length;g++)e=b[g],f[e]=d[e]||c[g];f.buttons=d.buttons||0;var h=0;return h=d.pressure?d.pressure:f.buttons?.5:0,f.x=f.clientX,f.y=f.clientY,f.pointerId=d.pointerId||0,f.width=d.width||0,f.height=d.height||0,f.pressure=h,f.tiltX=d.tiltX||0,f.tiltY=d.tiltY||0,f.pointerType=d.pointerType||"",f.hwTimestamp=d.hwTimestamp||0,f.isPrimary=d.isPrimary||!1,f._source=d._source||"",f}};a.eventFactory=e}(window.PolymerGestures),function(a){function b(){if(c){var a=new Map;return a.pointers=d,a}this.keys=[],this.values=[]}var c=window.Map&&window.Map.prototype.forEach,d=function(){return this.size};b.prototype={set:function(a,b){var c=this.keys.indexOf(a);c>-1?this.values[c]=b:(this.keys.push(a),this.values.push(b))},has:function(a){return this.keys.indexOf(a)>-1},"delete":function(a){var b=this.keys.indexOf(a);b>-1&&(this.keys.splice(b,1),this.values.splice(b,1))},get:function(a){var b=this.keys.indexOf(a);return this.values[b]},clLine truncated
LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ThisExpression:"ThisExpression",UnaryExpression:"UnaryExpression"},V={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"};var ab=H,bb=L;a.esprima={parse:R}}(this),function(a){"use strict";function b(a,b,d,e){var f;try{if(f=c(a),f.scopeIdent&&(d.nodeType!==Node.ELEMENT_NODE||"TEMPLATE"!==d.tagName||"bind"!==b&&"repeat"!==b))throw Error("as and in can only be used within <template bind/repeat>")}catch(g){return void console.error("Invalid expression syntax: "+a,g)}return function(a,b,c){var d=f.getBinding(a,e,c);return f.scopeIdent&&d&&(b.polymerExpressionScopeIdent_=f.scopeIdent,f.indexIdent&&(b.polymerExpressionIndexIdent_=f.indexIdent)),d}}function c(a){var b=q[a];if(!b){var c=new j;esprima.parse(a,c),b=new l(c),q[a]=b}return b}function d(a){this.value=a,this.valueFn_=void 0}function e(a){this.name=a,this.path=Path.get(a)}function f(a,b,c){this.computed="["==c,this.dynamicDeps="function"==typeof a||a.dynamicDeps||this.computed&&!(b instanceof d),this.simplePath=!this.dynamicDeps&&(b instanceof e||b instanceof d)&&(a instanceof f||a instanceof e),this.object=this.simplePath?a:i(a),this.property=!this.computed||this.simplePath?b:i(b)}function g(a,b){this.name=a,this.args=[];for(var c=0;c<b.length;c++)this.args[c]=i(b[c])}function h(){throw Error("Not Implemented")}function i(a){return"function"==typeof a?a:a.valueFn()}function j(){this.expression=null,this.filters=[],this.deps={},this.currentPath=void 0,this.scopeIdent=void 0,this.indexIdent=void 0,this.dynamicDeps=!1}function k(a){this.value_=a}function l(a){if(this.scopeIdent=a.scopeIdent,this.indexIdent=a.indexIdent,!a.expression)throw Error("No expression found.");this.expression=a.expression,i(this.expression),this.filters=a.filters,this.dynamicDeps=a.dynamicDeps}function m(a){return String(a).replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()})}function n(a,b){for(;a[t]&&!Object.prototype.hasOwnProperty.call(a,b);)a=a[t];return a}function o(a){switch(a){case"":return!1;case"false":case"null":case"true":return!0}return isNaN(Number(a))?!1:!0}function p(){}var q=Object.create(null);d.prototype={valueFn:function(){if(!this.valueFn_){var a=this.value;this.valueFn_=function(){return a}}return this.valueFn_}},e.prototype={valueFn:function(){if(!this.valueFn_){var a=(this.name,this.path);this.valueFn_=function(b,c){return c&&c.addPath(b,a),a.getValueFrom(b)}}return this.valueFn_},setValue:function(a,b){return 1==this.path.length&&(a=n(a,this.path[0])),this.path.setValueFrom(a,b)}},f.prototype={get fullPath(){if(!this.fullPath_){var a=this.object instanceof f?this.object.fullPath.slice():[this.object.name];a.push(this.property instanceof e?this.property.name:this.property.value),this.fullPath_=Path.get(a)}return this.fullPath_},valueFn:function(){if(!this.valueFn_){var a=this.object;if(this.simplePath){var b=this.fullPath;this.valueFn_=function(a,c){return c&&c.addPath(a,b),b.getValueFrom(a)}}else if(this.computed){var c=this.property;this.valueFn_=function(b,d,e){var f=a(b,d,e),g=c(b,d,e);return d&&d.addPath(f,[g]),f?f[g]:void 0}}else{var b=Path.get(this.property.name);this.valueFn_=function(c,d,e){var f=a(c,d,e);return d&&d.addPath(f,b),b.getValueFrom(f)}}}return this.valueFn_},setValue:function(a,b){if(this.simplePath)return this.fullPath.setValueFrom(a,b),b;var c=this.object(a),d=this.property instanceof e?this.property.name:this.property(a);return c[d]=b}},g.prototype={transform:function(a,b,c,d,e){var f=a,g=f[this.name];if(!g&&(g=c[this.name],!g))return void console.error("Cannot find function or filter: "+this.name);if(d?g=g.toModel:"function"==typeof g.toDOM&&(g=g.toDOM),"function"!=typeof g)return void console.error("Cannot find function or filter: "+this.name);for(var h=e||[],j=0;j<this.args.length;j++)h.push(i(this.args[j])(a,b,c));return g.apply(f,h)}};var r={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},s={"+":function(a,b){return a+b},"-":function(a,b){return a-b},"*":function(a,b){return a*b},"/":function(a,b){return a/b},"%":function(a,b){return a%b},"<":function(a,b){return b>a},">":function(a,b){return a>b},"<=":function(a,b){return b>=a},">=":function(a,b){return a>=b},"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"===":function(a,b){return a===b},"!==":function(a,b){return a!==b},"&&":function(a,b){return a&&b},"||":function(a,b){return a||b}};j.prototype={createUnaryExpression:function(a,b){if(!r[a])throw Error("Disallowed operator: "+a);return b=i(b),function(c,d,e){return r[a](b(c,d,e))}},createBinaryExpression:function(a,b,c){if(!s[a])throw Error("Disallowed operator: "+a);switch(b=i(b),c=i(c),a){case"||":return this.dynamicDeps=!0,function(a,d,e){return b(a,d,e)||c(a,d,e)};case"&&":return this.dynamicDeps=!0,function(a,d,e){return b(a,d,e)&&c(a,d,e)}}return functiLine truncated
<div hidden><polymer-element name="core-style" hidden assetpath="polymer/bower_components/core-style/"><script>(function(){window.CoreStyle=window.CoreStyle||{g:{},list:{},refMap:{}};Polymer("core-style",{publish:{ref:""},g:CoreStyle.g,refMap:CoreStyle.refMap,list:CoreStyle.list,ready:function(){if(this.id){this.provide()}else{this.registerRef(this.ref);if(!window.ShadowDOMPolyfill){this.require()}}},attached:function(){if(!this.id&&window.ShadowDOMPolyfill){this.require()}},provide:function(){this.register();if(this.textContent){this._completeProvide()}else{this.async(this._completeProvide)}},register:function(){var i=this.list[this.id];if(i){if(!Array.isArray(i)){this.list[this.id]=[i]}this.list[this.id].push(this)}else{this.list[this.id]=this}},_completeProvide:function(){this.createShadowRoot();this.domObserver=new MutationObserver(this.domModified.bind(this)).observe(this.shadowRoot,{subtree:true,characterData:true,childList:true});this.provideContent()},provideContent:function(){this.ensureTemplate();this.shadowRoot.textContent="";this.shadowRoot.appendChild(this.instanceTemplate(this.template));this.cssText=this.shadowRoot.textContent},ensureTemplate:function(){if(!this.template){this.template=this.querySelector("template:not([repeat]):not([bind])");if(!this.template){this.template=document.createElement("template");var n=this.firstChild;while(n){this.template.content.appendChild(n.cloneNode(true));n=n.nextSibling}}}},domModified:function(){this.cssText=this.shadowRoot.textContent;this.notify()},notify:function(){var s$=this.refMap[this.id];if(s$){for(var i=0,s;s=s$[i];i++){s.require()}}},registerRef:function(ref){this.refMap[this.ref]=this.refMap[this.ref]||[];this.refMap[this.ref].push(this)},applyRef:function(ref){this.ref=ref;this.registerRef(this.ref);this.require()},require:function(){var cssText=this.cssTextForRef(this.ref);if(cssText){this.ensureStyleElement();if(this.styleElement._cssText===cssText){return}this.styleElement._cssText=cssText;if(window.ShadowDOMPolyfill){this.styleElement.textContent=cssText;cssText=WebComponents.ShadowCSS.shimStyle(this.styleElement,this.getScopeSelector())}this.styleElement.textContent=cssText}},cssTextForRef:function(ref){var s$=this.byId(ref);var cssText="";if(s$){if(Array.isArray(s$)){var p=[];for(var i=0,l=s$.length,s;i<l&&(s=s$[i]);i++){p.push(s.cssText)}cssText=p.join("\n\n")}else{cssText=s$.cssText}}if(s$&&!cssText){console.warn("No styles provided for ref:",ref)}return cssText},byId:function(id){return this.list[id]},ensureStyleElement:function(){if(!this.styleElement){this.styleElement=window.ShadowDOMPolyfill?this.makeShimStyle():this.makeRootStyle()}if(!this.styleElement){console.warn(this.localName,"could not setup style.")}},makeRootStyle:function(){var style=document.createElement("style");this.appendChild(style);return style},makeShimStyle:function(){var host=this.findHost(this);if(host){var name=host.localName;var style=document.querySelector("style["+name+"="+this.ref+"]");if(!style){style=document.createElement("style");style.setAttribute(name,this.ref);document.head.appendChild(style)}return style}},getScopeSelector:function(){if(!this._scopeSelector){var selector="",host=this.findHost(this);if(host){var typeExtension=host.hasAttribute("is");var name=typeExtension?host.getAttribute("is"):host.localName;selector=WebComponents.ShadowCSS.makeScopeSelector(name,typeExtension)}this._scopeSelector=selector}return this._scopeSelector},findHost:function(node){while(node.parentNode){node=node.parentNode}return node.host||wrap(document.documentElement)},cycle:function(rgb,amount){if(rgb.match("#")){var o=this.hexToRgb(rgb);if(!o){return rgb}rgb="rgb("+o.r+","+o.b+","+o.g+")"}function cycleChannel(v){return Math.abs((Number(v)-amount)%255)}return rgb.replace(/rgb\(([^,]*),([^,]*),([^,]*)\)/,function(m,a,b,c){return"rgb("+cycleChannel(a)+","+cycleChannel(b)+", "+cycleChannel(c)+")"})},hexToRgb:function(hex){var result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);return result?{r:parseInt(result[1],16),g:parseInt(result[2],16),b:parseInt(result[3],16)}:null}})})();</script></polymer-element><core-style id="ha-main">
/* Palette generated by Material Palette - materialpalette.com/light-blue/orange */
if(this.removeAttribute("value"),c)return j(this,"value",b);var e=b,f=m(this,"value",e);return j(this,"value",e.open(k(this,"value",d))),t(this,a,f)},HTMLOptionElement.prototype.bind=function(a,b,c){if("value"!==a)return HTMLElement.prototype.bind.call(this,a,b,c);if(this.removeAttribute("value"),c)return q(this,b);var d=b,e=m(this,"value",d);return q(this,d.open(r(this))),t(this,a,e)},HTMLSelectElement.prototype.bind=function(a,c,d){if("selectedindex"===a&&(a="selectedIndex"),"selectedIndex"!==a&&"value"!==a)return HTMLElement.prototype.bind.call(this,a,c,d);if(this.removeAttribute(a),d)return j(this,a,c);var e=c,f=m(this,a,e);return j(this,a,e.open(k(this,a))),b(this,a,f)}}(this),function(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a){for(var b;b=a.parentNode;)a=b;return a}function d(a,b){if(b){for(var d,e="#"+b;!d&&(a=c(a),a.protoContent_?d=a.protoContent_.querySelector(e):a.getElementById&&(d=a.getElementById(b)),!d&&a.templateCreator_);)a=a.templateCreator_;return d}}function e(a){return"template"==a.tagName&&"http://www.w3.org/2000/svg"==a.namespaceURI}function f(a){return"TEMPLATE"==a.tagName&&"http://www.w3.org/1999/xhtml"==a.namespaceURI}function g(a){return Boolean(L[a.tagName]&&a.hasAttribute("template"))}function h(a){return void 0===a.isTemplate_&&(a.isTemplate_="TEMPLATE"==a.tagName||g(a)),a.isTemplate_}function i(a,b){var c=a.querySelectorAll(N);h(a)&&b(a),G(c,b)}function j(a){function b(a){HTMLTemplateElement.decorate(a)||j(a.content)}i(a,b)}function k(a,b){Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))})}function l(a){var b=a.ownerDocument;if(!b.defaultView)return b;var c=b.templateContentsOwner_;if(!c){for(c=b.implementation.createHTMLDocument("");c.lastChild;)c.removeChild(c.lastChild);b.templateContentsOwner_=c}return c}function m(a){if(!a.stagingDocument_){var b=a.ownerDocument;if(!b.stagingDocument_){b.stagingDocument_=b.implementation.createHTMLDocument(""),b.stagingDocument_.isStagingDocument=!0;var c=b.stagingDocument_.createElement("base");c.href=document.baseURI,b.stagingDocument_.head.appendChild(c),b.stagingDocument_.stagingDocument_=b.stagingDocument_}a.stagingDocument_=b.stagingDocument_}return a.stagingDocument_}function n(a){var b=a.ownerDocument.createElement("template");a.parentNode.insertBefore(b,a);for(var c=a.attributes,d=c.length;d-->0;){var e=c[d];K[e.name]&&("template"!==e.name&&b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function o(a){var b=a.ownerDocument.createElement("template");a.parentNode.insertBefore(b,a);for(var c=a.attributes,d=c.length;d-->0;){var e=c[d];b.setAttribute(e.name,e.value),a.removeAttribute(e.name)}return a.parentNode.removeChild(a),b}function p(a,b,c){var d=a.content;if(c)return void d.appendChild(b);for(var e;e=b.firstChild;)d.appendChild(e)}function q(a){P?a.__proto__=HTMLTemplateElement.prototype:k(a,HTMLTemplateElement.prototype)}function r(a){a.setModelFn_||(a.setModelFn_=function(){a.setModelFnScheduled_=!1;var b=z(a,a.delegate_&&a.delegate_.prepareBinding);w(a,b,a.model_)}),a.setModelFnScheduled_||(a.setModelFnScheduled_=!0,Observer.runEOM_(a.setModelFn_))}function s(a,b,c,d){if(a&&a.length){for(var e,f=a.length,g=0,h=0,i=0,j=!0;f>h;){var g=a.indexOf("{{",h),k=a.indexOf("[[",h),l=!1,m="}}";if(k>=0&&(0>g||g>k)&&(g=k,l=!0,m="]]"),i=0>g?-1:a.indexOf(m,g+2),0>i){if(!e)return;e.push(a.slice(h));break}e=e||[],e.push(a.slice(h,g));var n=a.slice(g+2,i).trim();e.push(l),j=j&&l;var o=d&&d(n,b,c);e.push(null==o?Path.get(n):null),e.push(o),h=i+2}return h===f&&e.push(""),e.hasOnePath=5===e.length,e.isSimplePath=e.hasOnePath&&""==e[0]&&""==e[4],e.onlyOneTime=j,e.combinator=function(a){for(var b=e[0],c=1;c<e.length;c+=4){var d=e.hasOnePath?a:a[(c-1)/4];void 0!==d&&(b+=d),b+=e[c+3]}return b},e}}function t(a,b,c,d){if(b.hasOnePath){var e=b[3],f=e?e(d,c,!0):b[2].getValueFrom(d);return b.isSimplePath?f:b.combinator(f)}for(var g=[],h=1;h<b.length;h+=4){var e=b[h+2];g[(h-1)/4]=e?e(d,c):b[h+1].getValueFrom(d)}return b.combinator(g)}function u(a,b,c,d){var e=b[3],f=e?e(d,c,!1):new PathObserver(d,b[2]);return b.isSimplePath?f:new ObserverTransform(f,b.combinator)}function v(a,b,c,d){if(b.onlyOneTime)return t(a,b,c,d);if(b.hasOnePath)return u(a,b,c,d);for(var e=new CompoundObserver,f=1;f<b.length;f+=4){var g=b[f],h=b[f+2];if(h){var i=h(d,c,g);g?e.addPath(i):e.addObserver(i)}else{var j=b[f+1];g?e.addPath(j.getValueFrom(d)):e.addPath(d,j)}}return new ObserverTransform(e,b.combinator)}function w(a,b,c,d){for(var e=0;e<b.length;e+=2){var f=b[e],g=b[e+1],h=v(f,g,a,c),i=a.bind(f,h,g.onlyOneTime);i&&d&&d.push(i)}if(a.bindFinished(),b.isTemplate){a.model_=c;var j=a.processBindingDirectives_(b);d&&j&&d.push(j)}}function x(a,b,c){var d=a.getAttribute(b);return s(""==d?"{{}}":d,b,a,c)}function y(a,c){b(a);for(var d=[],e=0;e<a.attributes.length;e++){for(var f=a.attributes[e],g=f.name,i=f.value;"_"===g[0];)g=g.substring(1);if(!h(a)||g!==J&&g!==H&Line truncated
b&&b.classList.remove(c),a&&a.classList.add(c)},injectBoundHTML:function(a,b){var c=document.createElement("template");c.innerHTML=a;var d=this.instanceTemplate(c);return b&&(b.textContent="",b.appendChild(d)),d}},c=function(){},d={};b.asyncMethod=b.async,a.api.instance.utils=b,a.nop=c,a.nob=d}(Polymer),function(a){var b=window.WebComponents?WebComponents.flags.log:{},c="on-",d={EVENT_PREFIX:c,addHostListeners:function(){var a=this.eventDelegates;b.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.localName,a);for(var c in a){var d=a[c];PolymerGestures.addEventListener(this,c,this.element.getEventHandler(this,this,d))}},dispatchMethod:function(a,c,d){if(a){b.events&&console.group("[%s] dispatch [%s]",a.localName,c);var e="function"==typeof c?c:a[c];e&&e[d?"apply":"call"](a,d),b.events&&console.groupEnd(),Polymer.flush()}}};a.api.instance.events=d,a.addEventListener=function(a,b,c,d){PolymerGestures.addEventListener(wrap(a),b,c,d)},a.removeEventListener=function(a,b,c,d){PolymerGestures.removeEventListener(wrap(a),b,c,d)}}(Polymer),function(a){var b={copyInstanceAttributes:function(){var a=this._instanceAttributes;for(var b in a)this.hasAttribute(b)||this.setAttribute(b,a[b])},takeAttributes:function(){if(this._publishLC)for(var a,b=0,c=this.attributes,d=c.length;(a=c[b])&&d>b;b++)this.attributeToProperty(a.name,a.value)},attributeToProperty:function(b,c){var b=this.propertyForAttribute(b);if(b){if(c&&c.search(a.bindPattern)>=0)return;var d=this[b],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:function(a){var b=this._publishLC&&this._publishLC[a];return b},deserializeValue:function(b,c){return a.deserializeValue(b,c)},serializeValue:function(a,b){return"boolean"===b?a?"":void 0:"object"!==b&&"function"!==b&&void 0!==a?a:void 0},reflectPropertyToAttribute:function(a){var b=typeof this[a],c=this.serializeValue(this[a],b);void 0!==c?this.setAttribute(a,c):"boolean"===b&&this.removeAttribute(a)}};a.api.instance.attributes=b}(Polymer),function(a){function b(a,b){return a===b?0!==a||1/a===1/b:f(a)&&f(b)?!0:a!==a&&b!==b}function c(a,b){return void 0===b&&null===a?b:null===b||void 0===b?a:b}var d=window.WebComponents?WebComponents.flags.log:{},e={object:void 0,type:"update",name:void 0,oldValue:void 0},f=Number.isNaN||function(a){return"number"==typeof a&&isNaN(a)},g={createPropertyObserver:function(){var a=this._observeNames;if(a&&a.length){var b=this._propertyObserver=new CompoundObserver(!0);this.registerObserver(b);for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)b.addPath(this,c),this.observeArrayValue(c,this[c],null)}},openPropertyObserver:function(){this._propertyObserver&&this._propertyObserver.open(this.notifyPropertyChanges,this)},notifyPropertyChanges:function(a,b,c){var d,e,f={};for(var g in b)if(d=c[2*g+1],e=this.observe[d]){var h=b[g],i=a[g];this.observeArrayValue(d,i,h),f[e]||(void 0!==h&&null!==h||void 0!==i&&null!==i)&&(f[e]=!0,this.invokeMethod(e,[h,i,arguments]))}},invokeMethod:function(a,b){var c=this[a]||a;"function"==typeof c&&c.apply(this,b)},deliverChanges:function(){this._propertyObserver&&this._propertyObserver.deliver()},observeArrayValue:function(a,b,c){var e=this.observe[a];if(e&&(Array.isArray(c)&&(d.observe&&console.log("[%s] observeArrayValue: unregister observer [%s]",this.localName,a),this.closeNamedObserver(a+"__array")),Array.isArray(b))){d.observe&&console.log("[%s] observeArrayValue: register observer [%s]",this.localName,a,b);var f=new ArrayObserver(b);f.open(function(a){this.invokeMethod(e,[a])},this),this.registerNamedObserver(a+"__array",f)}},emitPropertyChangeRecord:function(a,c,d){if(!b(c,d)&&(this._propertyChanged(a,c,d),Observer.hasObjectObserve)){var f=this._objectNotifier;f||(f=this._objectNotifier=Object.getNotifier(this)),e.object=this,e.name=a,e.oldValue=d,f.notify(e)}},_propertyChanged:function(a){this.reflect[a]&&this.reflectPropertyToAttribute(a)},bindProperty:function(a,b,d){if(d)return void(this[a]=b);var e=this.element.prototype.computed;if(e&&e[a]){var f=a+"ComputedBoundObservable_";return void(this[f]=b)}return this.bindToAccessor(a,b,c)},bindToAccessor:function(a,c,d){function e(b,c){j[f]=b;var d=j[h];d&&"function"==typeof d.setValue&&d.setValue(b),j.emitPropertyChangeRecord(a,b,c)}var f=a+"_",g=a+"Observable_",h=a+"ComputedBoundObservable_";this[g]=c;var i=this[f],j=this,k=c.open(e);if(d&&!b(i,k)){var l=d(i,k);b(k,l)||(k=l,c.setValue&&c.setValue(k))}e(k,i);var m={close:function(){c.close(),j[g]=void 0,j[h]=void 0}};return this.registerObserver(m),m},createComputedProperties:function(){if(this._computedNames)for(var a=0;a<this._computedNames.length;a++){var b=this._computedNames[a],c=this.computed[b];try{var d=PolymerExpressions.getExpression(c),e=d.getBinding(this,this.element.syntax);this.bindToAccessor(b,e)}catch(f){console.error("Failed to create computed property",f)}}},registerObserver:function(a){return this._observers?void this._observers.push(a):void(this._observers=[a])},closeObservers:function(){if(thiLine truncated
.dark-primary-color { background: #0288D1; }
.default-primary-color { background: #03A9F4; }
.light-primary-color { background: #B3E5FC; }
.text-primary-color { color: #FFFFFF; }
.accent-color { background: #FF9800; }
.primary-text-color { color: #212121; }
.secondary-text-color { color: #727272; }
.divider-color { border-color: #B6B6B6; }
},ct.prototype.__iterate=function(t,e){var n=this,r=0;return this._iter.__iterate(function(e){return t(e,r++,n)},e)},ct.prototype.__iterator=function(t,e){var n=this._iter.__iterator(wn,e),r=0;return new T(function(){var e=n.next();return e.done?e:b(t,r++,e.value,e)})},t(ft,D),ft.prototype.has=function(t){return this._iter.includes(t)},ft.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},ft.prototype.__iterator=function(t,e){var n=this._iter.__iterator(wn,e);return new T(function(){var e=n.next();return e.done?e:b(t,e.value,e.value,e)})},t(lt,C),lt.prototype.entrySeq=function(){return this._iter.toSeq()},lt.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){Ct(e);var r=d(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},lt.prototype.__iterator=function(t,e){var n=this._iter.__iterator(wn,e);return new T(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){Ct(r);var i=d(r);return b(t,i?r.get(0):r[0],i?r.get(1):r[1],e)}}})},ct.prototype.cacheResult=st.prototype.cacheResult=ft.prototype.cacheResult=lt.prototype.cacheResult=Rt,t(zt,H),zt.prototype.toString=function(){return this.__toString("Map {","}")},zt.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},zt.prototype.set=function(t,e){return Jt(this,t,e)},zt.prototype.setIn=function(t,e){return this.updateIn(t,hn,function(){return e})},zt.prototype.remove=function(t){return Jt(this,t,hn)},zt.prototype.deleteIn=function(t){return this.updateIn(t,function(){return hn})},zt.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},zt.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=oe(this,Lt(t),e,n);return r===hn?void 0:r},zt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Bt()},zt.prototype.merge=function(){return ne(this,void 0,arguments)},zt.prototype.mergeWith=function(t){var e=an.call(arguments,1);return ne(this,t,e)},zt.prototype.mergeIn=function(t){var e=an.call(arguments,1);return this.updateIn(t,Bt(),function(t){return t.merge.apply(t,e)})},zt.prototype.mergeDeep=function(){return ne(this,re(void 0),arguments)},zt.prototype.mergeDeepWith=function(t){var e=an.call(arguments,1);return ne(this,re(t),e)},zt.prototype.mergeDeepIn=function(t){var e=an.call(arguments,1);return this.updateIn(t,Bt(),function(t){return t.mergeDeep.apply(t,e)})},zt.prototype.sort=function(t){return Ee(It(this,t))},zt.prototype.sortBy=function(t,e){return Ee(It(this,e,t))},zt.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},zt.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new r)},zt.prototype.asImmutable=function(){return this.__ensureOwner()},zt.prototype.wasAltered=function(){return this.__altered},zt.prototype.__iterator=function(t,e){return new Kt(this,t,e)},zt.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},zt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ft(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},zt.isMap=Pt;var Pn="@@__IMMUTABLE_MAP__@@",qn=zt.prototype;qn[Pn]=!0,qn[sn]=qn.remove,qn.removeIn=qn.deleteIn,qt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(J(n,i[o][0]))return i[o][1];return r},qt.prototype.update=function(t,e,r,o,u,a,s){for(var c=u===hn,f=this.entries,l=0,h=f.length;h>l&&!J(o,f[l][0]);l++);var p=h>l;if(p?f[l][1]===u:c)return this;if(n(s),(c||!p)&&n(a),!c||1!==f.length){if(!p&&!c&&f.length>=Wn)return Qt(t,f,o,u);var _=t&&t===this.ownerID,v=_?f:i(f);return p?c?l===h-1?v.pop():v[l]=v.pop():v[l]=[o,u]:v.push([o,u]),_?(this.entries=v,this):new qt(t,v)}},Ut.prototype.get=function(t,e,n,r){void 0===e&&(e=et(n));var i=1<<((0===t?e:e>>>t)&ln),o=this.bitmap;return 0===(o&i)?r:this.nodes[ue(o&i-1)].get(t+cn,e,n,r)},Ut.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=et(r));var a=(0===e?n:n>>>e)&ln,s=1<<a,c=this.bitmap,f=0!==(c&s);if(!f&&i===hn)return this;var l=ue(c&s-1),h=this.nodes,p=f?h[l]:void 0,_=Yt(p,t,e+cn,n,r,i,o,u);if(_===p)return this;if(!f&&_&&h.length>=Vn)return ee(t,h,c,a,_);if(f&&!_&&2===h.length&&Xt(h[1^l]))return h[1^l];if(f&&_&&1===h.length&&Xt(_))return _;var v=t&&t===this.ownerID,d=f?_?c:c^s:c|s,y=f?_?ae(h,l,_,v):ce(h,l,v):se(h,l,_,v);return v?(this.bitmap=d,this.nodes=y,this):new Ut(t,d,y)},Wt.prototype.get=function(t,e,n,r){void 0===e&&(e=et(n));var i=(0===t?e:e>>>t)&ln,o=this.nodes[i];return o?o.get(t+cn,e,n,r):r},Wt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=et(r));var a=(0===e?n:n>>>e)&ln,s=i===hn,c=this.nodes,f=c[a];if(s&&!f)return this;var l=Yt(f,t,e+cn,n,r,i,o,u);if(l===f)return this;var h=this.count;if(f){if(!l&&(h--,Gn>h))return te(t,c,h,a)}else h++;var p=t&&t===thLine truncated
for(var n=-1,r=t.length,i=-1,o=[];++n<r;){var u=t[n];e(u,n,t)&&(o[++i]=u)}return o}function ae(t,e){for(var n=-1,r=t.length,i=So(r);++n<r;)i[n]=e(t[n],n,t);return i}function se(t){for(var e=-1,n=t.length,r=mu;++e<n;){var i=t[e];i>r&&(r=i)}return r}function ce(t){for(var e=-1,n=t.length,r=wu;++e<n;){var i=t[e];r>i&&(r=i)}return r}function fe(t,e,n,r){var i=-1,o=t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function le(t,e,n,r){var i=t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function he(t,e){for(var n=-1,r=t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function pe(t){for(var e=t.length,n=0;e--;)n+=+t[e]||0;return n}function _e(t,e){return t===A?e:t}function ve(t,e,n,r){return t!==A&&Wo.call(r,n)?t:e}function de(t,e,n){var r=ja(e);Qo.apply(r,Uu(e));for(var i=-1,o=r.length;++i<o;){var u=r[i],a=t[u],s=n(a,e[u],u,t,e);(s===s?s===a:a!==a)&&(a!==A||u in t)||(t[u]=s)}return t}function ye(t,e){for(var n=-1,r=t.length,i=Fn(r),o=e.length,u=So(o);++n<o;){var a=e[n];i?u[n]=Gn(a,r)?t[a]:A:u[n]=t[a]}return u}function ge(t,e,n){n||(n={});for(var r=-1,i=e.length;++r<i;){var o=e[r];n[o]=t[o]}return n}function me(t,e,n){var r=typeof t;return"function"==r?e===A?t:rn(t,e,n):null==t?ho:"object"==r?ze(t):e===A?mo(t):Pe(t,e)}function we(t,e,n,r,i,o,u){var a;if(n&&(a=i?n(t,r,i):n(t)),a!==A)return a;if(!Ti(t))return t;var s=Ea(t);if(s){if(a=qn(t),!e)return te(t,a)}else{var c=Go.call(t),f=c==Z;if(c!=et&&c!=F&&(!f||i))return $t[c]?Wn(t,c,e):i?t:{};if(a=Un(f?{}:t),!e)return ku(a,t)}o||(o=[]),u||(u=[]);for(var l=o.length;l--;)if(o[l]==t)return u[l];return o.push(t),u.push(a),(s?ee:ke)(t,function(r,i){a[i]=we(r,e,n,i,t,o,u)}),a}function Te(t,e,n){if("function"!=typeof t)throw new jo($);return ru(function(){t.apply(A,n)},e)}function be(t,e){var n=t?t.length:0,r=[];if(!n)return r;var i=-1,o=zn(),u=o==a,s=u&&e.length>=200?Lu(e):null,c=e.length;s&&(o=Zt,u=!1,e=s);t:for(;++i<n;){var f=t[i];if(u&&f===f){for(var l=c;l--;)if(e[l]===f)continue t;r.push(f)}else o(e,f,0)<0&&r.push(f)}return r}function Ee(t,e){var n=!0;return xu(t,function(t,r,i){return n=!!e(t,r,i)}),n}function Oe(t,e,n,r){var i=t.length;for(n=null==n?0:+n||0,0>n&&(n=-n>i?0:i+n),r=r===A||r>i?i:+r||0,0>r&&(r+=i),i=n>r?0:r>>>0,n>>>=0;i>n;)t[n++]=e;return t}function Ie(t,e){var n=[];return xu(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Se(t,e,n,r){var i;return n(t,function(t,n,o){return e(t,n,o)?(i=r?n:t,!1):void 0}),i}function Ae(t,e,n){for(var r=-1,i=t.length,o=-1,u=[];++r<i;){var a=t[r];if(m(a)&&Fn(a.length)&&(Ea(a)||_i(a))){e&&(a=Ae(a,e,n));var s=-1,c=a.length;for(u.length+=c;++s<c;)u[++o]=a[s]}else n||(u[++o]=a)}return u}function Ne(t,e){return Mu(t,e,Pi)}function ke(t,e){return Mu(t,e,ja)}function Ce(t,e){return Ru(t,e,ja)}function xe(t,e){for(var n=-1,r=e.length,i=-1,o=[];++n<r;){var u=e[n];Ia(t[u])&&(o[++i]=u)}return o}function De(t,e,n){if(null!=t){n!==A&&n in nr(t)&&(e=[n]);for(var r=-1,i=e.length;null!=t&&++r<i;)var o=t=t[e[r]];return o}}function Me(t,e,n,r,i,o){if(t===e)return 0!==t||1/t==1/e;var u=typeof t,a=typeof e;return"function"!=u&&"object"!=u&&"function"!=a&&"object"!=a||null==t||null==e?t!==t&&e!==e:Re(t,e,Me,n,r,i,o)}function Re(t,e,n,r,i,o,u){var a=Ea(t),s=Ea(e),c=B,f=B;a||(c=Go.call(t),c==F?c=et:c!=et&&(a=ki(t))),s||(f=Go.call(e),f==F?f=et:f!=et&&(s=ki(e)));var l=c==et,h=f==et,p=c==f;if(p&&!a&&!l)return Mn(t,e,c);if(!i){var _=l&&Wo.call(t,"__wrapped__"),v=h&&Wo.call(e,"__wrapped__");if(_||v)return n(_?t.value():t,v?e.value():e,r,i,o,u)}if(!p)return!1;o||(o=[]),u||(u=[]);for(var d=o.length;d--;)if(o[d]==t)return u[d]==e;o.push(t),u.push(e);var y=(a?Dn:Rn)(t,e,n,r,i,o,u);return o.pop(),u.pop(),y}function je(t,e,n,r,i){for(var o=-1,u=e.length,a=!i;++o<u;)if(a&&r[o]?n[o]!==t[e[o]]:!(e[o]in t))return!1;for(o=-1;++o<u;){var s=e[o],c=t[s],f=n[o];if(a&&r[o])var l=c!==A||s in t;else l=i?i(c,f,s):A,l===A&&(l=Me(f,c,i,!0));if(!l)return!1}return!0}function Le(t,e){var n=-1,r=qu(t),i=Fn(r)?So(r):[];return xu(t,function(t,r,o){i[++n]=e(t,r,o)}),i}function ze(t){var e=ja(t),n=e.length;if(!n)return lo(!0);if(1==n){var r=e[0],i=t[r];if(Bn(i))return function(t){return null==t?!1:t[r]===i&&(i!==A||r in nr(t))}}for(var o=So(n),u=So(n);n--;)i=t[e[n]],o[n]=i,u[n]=Bn(i);return function(t){return null!=t&&je(nr(t),e,o,u)}}function Pe(t,e){var n=Ea(t),r=$n(t)&&Bn(e),i=t+"";return t=rr(t),function(o){if(null==o)return!1;var u=i;if(o=nr(o),!(!n&&r||u in o)){if(o=1==t.length?o:De(o,He(t,0,-1)),null==o)return!1;u=gr(t),o=nr(o)}return o[u]===e?e!==A||u in o:Me(e,o[u],null,!0)}}function qe(t,e,n,r,i){if(!Ti(t))return t;var o=Fn(e.length)&&(Ea(e)||ki(e));if(!o){var u=ja(e);Qo.apply(u,Uu(e))}return ee(u||e,function(a,s){if(u&&(s=a,a=e[s]),m(a))r||(r=[]),i||(i=[]),Ue(t,e,s,qe,n,r,i);else{var c=t[s],f=n?n(c,a,s,t,e):A,l=f===A;l&&(f=a),!o&&f===A||!l&&(f===f?f===c:c!==c)||(t[s]=f)}}),t}function Ue(t,e,n,r,i,o,u){for(var a=o.length,s=e[n];a--;)if(o[a]==s)return void(t[n]=u[a]);var c=t[n],f=i?i(c,s,n,t,e):A,l=f===A;l&&(f=s,Fn(s.length)&&(Ea(s)||ki(s))?f=Ea(Line truncated
try{var e=Oi(e=t.Float64Array)&&e,n=new e(new Ho(10),0,1)&&e}catch(r){}return n}(),su=function(){var t={1:0},e=tu&&Oi(e=Do.assign)&&e;try{e(tu(t),"xo")}catch(n){}return!t[1]&&e}(),cu=Oi(cu=So.isArray)&&cu,fu=Oi(fu=Do.create)&&fu,lu=t.isFinite,hu=Oi(hu=Do.keys)&&hu,pu=Co.max,_u=Co.min,vu=Oi(vu=Ao.now)&&vu,du=Oi(du=xo.isFinite)&&du,yu=t.parseInt,gu=Co.random,mu=xo.NEGATIVE_INFINITY,wu=xo.POSITIVE_INFINITY,Tu=Co.pow(2,32)-1,bu=Tu-1,Eu=Tu>>>1,Ou=au?au.BYTES_PER_ELEMENT:0,Iu=Co.pow(2,53)-1,Su=uu&&new uu,Au={},Nu=e.support={};!function(t){var e=function(){this.x=t},n=[];e.prototype={valueOf:t,y:t};for(var r in new e)n.push(r);Nu.funcDecomp=/\bthis\b/.test(function(){return this}),Nu.funcNames="string"==typeof ko.name;try{Nu.dom=11===qo.createDocumentFragment().nodeType}catch(i){Nu.dom=!1}try{Nu.nonEnumArgs=!eu.call(arguments,1)}catch(i){Nu.nonEnumArgs=!0}}(1,0),e.templateSettings={escape:Et,evaluate:Ot,interpolate:It,variable:"",imports:{_:e}};var ku=su||function(t,e){return null==e?t:ge(e,Uu(e),ge(e,ja(e),t))},Cu=function(){function e(){}return function(n){if(Ti(n)){e.prototype=n;var r=new e;e.prototype=null}return r||t.Object()}}(),xu=fn(ke),Du=fn(Ce,!0),Mu=ln(),Ru=ln(!0),ju=Su?function(t,e){return Su.set(t,e),t}:ho;Fo||(on=Ho&&ou?function(t){var e=t.byteLength,n=au?Yo(e/Ou):0,r=n*Ou,i=new Ho(e);if(n){var o=new au(i,0,n);o.set(new au(t,0,n))}return e!=r&&(o=new ou(i,r),o.set(new ou(t,r))),i}:lo(null));var Lu=fu&&nu?function(t){return new Xt(t)}:lo(null),zu=Su?function(t){return Su.get(t)}:go,Pu=function(){return Nu.funcNames?"constant"==lo.name?We("name"):function(t){for(var e=t.name,n=Au[e],r=n?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}:lo("")}(),qu=We("length"),Uu=Xo?function(t){return Xo(nr(t))}:lo([]),Wu=function(){var t=0,e=0;return function(n,r){var i=fa(),o=W-(i-e);if(e=i,o>0){if(++t>=U)return n}else t=0;return ju(n,r)}}(),Vu=si(function(t,e){return Ea(t)||_i(t)?be(t,Ae(e,!1,!0)):[]}),Gu=gn(),Ku=gn(!0),$u=si(function(t,e){t||(t=[]),e=Ae(e);var n=ye(t,e);return Ge(t,e.sort(o)),n}),Hu=Cn(),Fu=Cn(!0),Bu=si(function(t){return Xe(Ae(t,!1,!0))}),Ju=si(function(t,e){return Ea(t)||_i(t)?be(t,e):[]}),Yu=si(kr),Xu=si(function(t,e){var n=t?qu(t):0;return Fn(n)&&(t=er(t)),ye(t,Ae(e))}),Zu=sn(function(t,e,n){Wo.call(t,n)?++t[n]:t[n]=1}),Qu=yn(xu),ta=yn(Du,!0),ea=Tn(ee,xu),na=Tn(ne,Du),ra=sn(function(t,e,n){Wo.call(t,n)?t[n].push(e):t[n]=[e]}),ia=sn(function(t,e,n){t[n]=e}),oa=si(function(t,e,n){var r=-1,i="function"==typeof e,o=$n(e),u=qu(t),a=Fn(u)?So(u):[];return xu(t,function(t){var u=i?e:o&&null!=t&&t[e];a[++r]=u?u.apply(t,n):Vn(t,e,n)}),a}),ua=sn(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),aa=Sn(fe,xu),sa=Sn(le,Du),ca=si(function(t,e){if(null==t)return[];var n=e[2];return n&&Kn(e[0],e[1],n)&&(e.length=1),Je(t,Ae(e),[])}),fa=vu||function(){return(new Ao).getTime()},la=si(function(t,e,n){var r=k;if(n.length){var i=T(n,la.placeholder);r|=R}return xn(t,r,e,n,i)}),ha=si(function(t,e){e=e.length?Ae(e):Ri(t);for(var n=-1,r=e.length;++n<r;){var i=e[n];t[i]=xn(t[i],k,t)}return t}),pa=si(function(t,e,n){var r=k|C;if(n.length){var i=T(n,pa.placeholder);r|=R}return xn(e,r,t,n,i)}),_a=vn(D),va=vn(M),da=si(function(t,e){return Te(t,1,e)}),ya=si(function(t,e,n){return Te(t,e,n)}),ga=wn(),ma=wn(!0),wa=In(R),Ta=In(j),ba=si(function(t,e){return xn(t,z,null,null,null,Ae(e))}),Ea=cu||function(t){return m(t)&&Fn(t.length)&&Go.call(t)==B};Nu.dom||(yi=function(t){return!!t&&1===t.nodeType&&m(t)&&!Sa(t)});var Oa=du||function(t){return"number"==typeof t&&lu(t)},Ia=s(/x/)||ou&&!s(ou)?function(t){return Go.call(t)==Z}:s,Sa=Zo?function(t){if(!t||Go.call(t)!=et)return!1;var e=t.valueOf,n=Oi(e)&&(n=Zo(e))&&Zo(n);return n?t==n||Zo(t)==n:Qn(t)}:Qn,Aa=cn(function(t,e,n){return n?de(t,e,n):ku(t,e)}),Na=si(function(t){var e=t[0];return null==e?e:(t.push(_e),Aa.apply(A,t))}),ka=mn(ke),Ca=mn(Ce),xa=bn(Mu),Da=bn(Ru),Ma=En(ke),Ra=En(Ce),ja=hu?function(t){if(t)var e=t.constructor,n=t.length;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&Fn(n)?tr(t):Ti(t)?hu(t):[]}:tr,La=cn(qe),za=si(function(t,e){if(null==t)return{};if("function"!=typeof e[0]){var e=ae(Ae(e),Ro);return Yn(t,be(Pi(t),e))}var n=rn(e[0],e[1],3);return Xn(t,function(t,e,r){return!n(t,e,r)})}),Pa=si(function(t,e){return null==t?{}:"function"==typeof e[0]?Xn(t,rn(e[0],e[1],3)):Yn(t,Ae(e))}),qa=pn(function(t,e,n){return e=e.toLowerCase(),t+(n?e.charAt(0).toUpperCase()+e.slice(1):e)}),Ua=pn(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Wa=On(),Va=On(!0);8!=yu(Wt+"08")&&(to=function(t,e,n){return(n?Kn(t,e,n):null==e)?e=0:e&&(e=+e),t=io(t),yu(t,e||(jt.test(t)?16:10))});var Ga=pn(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Ka=pn(function(t,e,n){return t+(n?" ":"")+(e.charAt(0).toUpperCase()+e.slice(1))}),$a=si(function(t,e){try{return t.apply(A,e)}catch(n){return wi(n)?n:new No(n)}}),Ha=si(function(t,e){return function(n){return Vn(n,t,e)}}),Fa=si(function(t,e){return function(n){return Vn(t,n,e)}}),Ba=dn(Line truncated
e}}(),c=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)};Object.defineProperty(e,"__esModule",{value:!0});var f=n(4),l=n(1),h=u(l),p=n(2),_=u(p),v=n(3),d=u(v),y=n(9),g=u(y),m=n(14),w=u(m),T=new f.Map,b=function(t){function e(){a(this,e),null!=t&&t.apply(this,arguments)}return c(e,t),s(e,[{key:"all",get:function(){return T.valueSeq().sortBy(r)}},{key:"get",value:function(t){return t=t.toLowerCase(),T.get(t)||null}},{key:"gets",value:function(t){return t=t.map(function(t){return t.toLowerCase()}),T.valueSeq().filter(function(e){return-1!==t.indexOf(e.entityId)}).sortBy(r)}},{key:"entityIDs",get:function(){return T.keySeq().sort()}},{key:"domains",get:function(){return T.keySeq().map(function(t){return t.split(".")[0]}).sort().toOrderedSet()}}]),e}(d["default"]),E=new b;E.dispatchToken=h["default"].register(function(t){switch(t.actionType){case _["default"].ACTION_NEW_STATES:(!g["default"].isStreaming||t.replace)&&(o(t.states,t.replace),E.emitChange());break;case _["default"].ACTION_REMOTE_EVENT_RECEIVED:t.event.event_type===_["default"].REMOTE_EVENT_STATE_CHANGED&&(i(t.event.data.new_state),E.emitChange());break;case _["default"].ACTION_LOG_OUT:T={},E.emitChange()}}),e["default"]=E,t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)};Object.defineProperty(e,"__esModule",{value:!0});var a=n(6),s=r(a),c=n(1),f=r(c),l=n(2),h=r(l),p=n(3),_=r(p),v=6e4,d=null,y={},g={},m=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"isStale",value:function(){var t=void 0===arguments[0]?null:arguments[0],e=null===t?d:y[t]||null;return null===e||(new Date).getTime()-e.getTime()>v}},{key:"get",value:function(t){return g[t]||null}},{key:"all",get:function(){return s["default"].values(g)}}]),e}(_["default"]),w=new m;w.dispatchToken=f["default"].register(function(t){switch(t.actionType){case h["default"].ACTION_NEW_STATE_HISTORY:s["default"].forEach(t.stateHistory,function(t){if(0!==t.length){var e=t[0].entityId;g[e]=t,y[e]=new Date}}),t.isFetchAll&&(d=new Date),w.emitChange();break;case h["default"].ACTION_LOG_OUT:d=null,y={},g={},w.emitChange()}}),e["default"]=w,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return-1!==y.indexOf(t)}function i(){return y.length===v}var o=function(t){return t&&t.__esModule?t:{"default":t}},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)};Object.defineProperty(e,"__esModule",{value:!0});var c=n(1),f=o(c),l=n(2),h=o(l),p=n(3),_=o(p),v=4,d=!1,y=[],g=function(t){function e(){u(this,e),null!=t&&t.apply(this,arguments)}return s(e,t),a(e,[{key:"isFetching",get:function(){return!i()}},{key:"initialLoadDone",get:function(){return d}},{key:"componentsLoaded",get:function(){return r(h["default"].ACTION_NEW_LOADED_COMPONENTS)}},{key:"eventsLoaded",get:function(){return r(h["default"].ACTION_NEW_EVENTS)}},{key:"servicesLoaded",get:function(){return r(h["default"].ACTION_NEW_SERVICES)}},{key:"statesLoaded",get:function(){return r(h["default"].ACTION_NEW_STATES)}}]),e}(_["default"]),m=new g;m.dispatchToken=f["default"].register(function(t){switch(t.actionType){case h["default"].ACTION_FETCH_ALL:y=[],m.emitChange();break;case h["default"].ACTION_NEW_LOADED_COMPONENTS:case h["default"].ACTION_NEW_EVENTS:case h["default"].ACTION_NEW_SERVICES:case h["default"].ACTION_NEW_STATES:r(t.actionType)||(y.push(t.actionType),d=d||i(),m.emitChange());break;case h["default"].ACTION_LOG_OUT:d=!1,y=[],m.emitChange()}}),e["default"]=m,t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e)Line truncated
/* extra */
.accent-text-color { color: #FF9800; }
body {
color: #212121;
}
a {
color: #FF9800;
text-decoration: none;
}
</core-style><core-style id="ha-animations">
@-webkit-keyframes ha-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes ha-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
.ha-spin {
-webkit-animation: ha-spin 2s infinite linear;
animation: ha-spin 2s infinite linear;
}
</core-style><core-style id="ha-headers">
core-scroll-header-panel, core-header-panel {
background-color: #E5E5E5;
}
core-toolbar {
background: #03a9f4;
color: white;
font-weight: normal;
}
</core-style><core-style id="ha-dialog">
:host {
font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
min-width: 350px;
max-width: 700px;
/* First two are from core-transition-bottom */
transition:
transform 0.2s ease-in-out,
opacity 0.2s ease-in,
top .3s,
left .3s !important;
}
:host .sidebar {
margin-left: 30px;
}
@media all and (max-width: 620px) {
:host.two-column {
margin: 0;
width: 100%;
max-height: calc(100% - 64px);
bottom: 0px;
left: 0px;
right: 0px;
}
:host .sidebar {
display: none;
}
}
@media all and (max-width: 464px) {
:host {
margin: 0;
width: 100%;
max-height: calc(100% - 64px);
bottom: 0px;
left: 0px;
right: 0px;
}
}
html /deep/ .ha-form paper-input {
display: block;
}
html /deep/ .ha-form paper-input:first-child {
padding-top: 0;
}
</core-style><core-style id="ha-key-value-table">
.data-entry {
margin-bottom: 8px;
}
.data-entry:last-child {
margin-bottom: 0;
}
.data-entry .key {
margin-right: 8px;
}
.data-entry .value {
text-align: right;
word-break: break-all;
}
</core-style><core-style id="ha-paper-toggle">
paper-toggle-button::shadow .toggle-ink {
color: #039be5;
}
paper-toggle-button::shadow [checked] .toggle-bar {
background-color: #039be5;
}
paper-toggle-button::shadow [checked] .toggle-button {
background-color: #039be5;
}
</core-style></div>
<div hidden><script>!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t["default"]:t},i=r(n(1)),o=e.hass={callApi:n(5),dispatcher:i,constants:n(2),util:n(24),authActions:n(28),componentActions:n(25),eventActions:n(26),serviceActions:n(11),stateActions:n(12),syncActions:n(13),stateHistoryActions:n(30),streamActions:n(27),voiceActions:n(31),logbookActions:n(29),authStore:n(7),componentStore:n(15),eventStore:n(16),serviceStore:n(8),stateStore:n(20),syncStore:n(22),stateHistoryStore:n(21),streamStore:n(9),preferenceStore:n(19),notificationStore:n(18),voiceStore:n(23),logbookStore:n(17),stateModel:n(14),storeListenerMixIn:n(32)};"hass"in window||(window.hass=o),Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";var r=n(35),i=r.Dispatcher;t.exports=new i},function(t,e,n){"use strict";var r=n(6),i=["ACTION_LOG_OUT","ACTION_VALIDATING_AUTH_TOKEN","ACTION_VALID_AUTH_TOKEN","ACTION_INVALID_AUTH_TOKEN","ACTION_FETCH_ALL","ACTION_NEW_LOADED_COMPONENTS","ACTION_NEW_EVENTS","ACTION_NEW_SERVICES","ACTION_NEW_STATES","ACTION_NEW_STATE_HISTORY","ACTION_NEW_LOGBOOK","ACTION_NEW_NOTIFICATION","ACTION_SET_PREFERENCE","ACTION_EVENT_FIRED","ACTION_INITIAL_LOAD_DONE","ACTION_STREAM_START","ACTION_STREAM_STOP","ACTION_STREAM_ERROR","ACTION_REMOTE_EVENT_RECEIVED","ACTION_LISTENING_START","ACTION_LISTENING_TRANSMITTING","ACTION_LISTENING_DONE","ACTION_LISTENING_ERROR","ACTION_LISTENING_RESULT"];t.exports=r.merge({REMOTE_EVENT_HOMEASSISTANT_START:"homeassistant_start",REMOTE_EVENT_HOMEASSISTANT_STOP:"homeassistant_stop",REMOTE_EVENT_STATE_CHANGED:"state_changed",REMOTE_EVENT_TIME_CHANGED:"time_changed",REMOTE_EVENT_CALL_SERVICE:"call_service",REMOTE_EVENT_SERVICE_EXECUTED:"service_executed",REMOTE_EVENT_PLATFORM_DISCOVERED:"platform_discovered",REMOTE_EVENT_SERVICE_REGISTERED:"service_registered",REMOTE_EVENT_COMPONENT_LOADED:"component_loaded",UNIT_TEMP_C:"°C",UNIT_TEMP_F:"°F"},r.zipObject(i,i))},function(t,e,n){"use strict";var r=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},i=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=n(39).EventEmitter,a="change",s=function(t){function e(){o(this,e),null!=t&&t.apply(this,arguments)}return i(e,t),r(e,null,{emitChange:{value:function(){this.emit(a)},writable:!0,configurable:!0},addChangeListener:{value:function(t){this.on(a,t)},writable:!0,configurable:!0},removeChangeListener:{value:function(t){this.removeListener(a,t)},writable:!0,configurable:!0}}),e}(u);t.exports=s},function(t){!function(e,n){t.exports=n()}(this,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return t.value=!1,t}function n(t){t&&(t.value=!0)}function r(){}function i(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i=0;n>i;i++)r[i]=t[i+e];return r}function o(t){return void 0===t.size&&(t.size=t.__iterate(a)),t.size}function u(t,e){return e>=0?+e:o(t)+ +e}function a(){return!0}function s(t,e,n){return(0===t||void 0!==n&&-n>=t)&&(void 0===e||void 0!==n&&e>=n)}function c(t,e){return l(t,e,0)}function f(t,e){return l(t,e,e)}function l(t,e,n){return void 0===t?n:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function h(t){return y(t)?t:C(t)}function p(t){return d(t)?t:D(t)}function _(t){return g(t)?t:x(t)}function v(t){return y(t)&&!m(t)?t:M(t)}function y(t){return!(!t||!t[pr])}function d(t){return!(!t||!t[_r])}function g(t){return!(!t||!t[vr])}function m(t){return d(t)||g(t)}function w(t){return!(!t||!t[yr])}function T(t){this.next=t}function b(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function E(){return{value:void 0,done:!0}}function O(t){return!!A(t)}function I(t){return t&&"function"==typeof t.next}function S(t){var e=A(t);return e&&e.call(t)}function A(t){var e=t&&(wr&&t[wr]||t[Tr]);return"function"==typeof e?e:void 0}function N(t){return t&&"number"==typeof t.length}function C(t){return null===t||void 0===t?P():y(t)?t.toSeq():W(t)}function D(t){return null===t||void 0===t?P().toKeyedSeq():y(t)?d(t)?t.toSeq():t.fromEntrySeq():q(t)}function x(t){return null===t||void 0===t?P():y(t)?d(t)?t.entrySeq():t.toIndexedSeq():U(t)}function M(t){return(null===t||void 0===t?P():y(t)?d(t)?t.entrySeq():t:U(t)).toSetSeq()}function R(t){this._array=t,this.size=t.length}function k(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function j(t){this._iterable=t,this.size=t.length||t.size}function L(t){Line truncated
})},t(le,D),le.prototype.entrySeq=function(){return this._iter.toSeq()},le.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return e?(De(e),t(e[1],e[0],n)):void 0},e)},le.prototype.__iterator=function(t,e){var n=this._iter.__iterator(gr,e);return new T(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r)return De(r),t===mr?e:b(t,r[0],r[1],e)}})},ce.prototype.cacheResult=se.prototype.cacheResult=fe.prototype.cacheResult=le.prototype.cacheResult=ke,t(ze,H),ze.prototype.toString=function(){return this.__toString("Map {","}")},ze.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},ze.prototype.set=function(t,e){return Je(this,t,e)},ze.prototype.setIn=function(t,e){return this.updateIn(t,fr,function(){return e})},ze.prototype.remove=function(t){return Je(this,t,fr)},ze.prototype.deleteIn=function(t){return this.updateIn(t,function(){return fr})},ze.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},ze.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=un(this,Le(t),e,n);return r===fr?void 0:r},ze.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Be()},ze.prototype.merge=function(){return nn(this,void 0,arguments)},ze.prototype.mergeWith=function(t){var e=or.call(arguments,1);return nn(this,t,e)},ze.prototype.mergeIn=function(t){var e=or.call(arguments,1);return this.updateIn(t,Be(),function(t){return t.merge.apply(t,e)})},ze.prototype.mergeDeep=function(){return nn(this,rn(void 0),arguments)},ze.prototype.mergeDeepWith=function(t){var e=or.call(arguments,1);return nn(this,rn(t),e)},ze.prototype.mergeDeepIn=function(t){var e=or.call(arguments,1);return this.updateIn(t,Be(),function(t){return t.mergeDeep.apply(t,e)})},ze.prototype.sort=function(t){return On(Ie(this,t))},ze.prototype.sortBy=function(t,e){return On(Ie(this,e,t))},ze.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},ze.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new r)},ze.prototype.asImmutable=function(){return this.__ensureOwner()},ze.prototype.wasAltered=function(){return this.__altered},ze.prototype.__iterator=function(t,e){return new Ke(this,t,e)},ze.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},ze.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Fe(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},ze.isMap=Pe;var kr="@@__IMMUTABLE_MAP__@@",jr=ze.prototype;jr[kr]=!0,jr[ur]=jr.remove,jr.removeIn=jr.deleteIn,qe.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(J(n,i[o][0]))return i[o][1];return r},qe.prototype.update=function(t,e,r,o,u,a,s){for(var c=u===fr,f=this.entries,l=0,h=f.length;h>l&&!J(o,f[l][0]);l++);var p=h>l;if(p?f[l][1]===u:c)return this;if(n(s),(c||!p)&&n(a),!c||1!==f.length){if(!p&&!c&&f.length>=zr)return Qe(t,f,o,u);var _=t&&t===this.ownerID,v=_?f:i(f);return p?c?l===h-1?v.pop():v[l]=v.pop():v[l]=[o,u]:v.push([o,u]),_?(this.entries=v,this):new qe(t,v)}},Ue.prototype.get=function(t,e,n,r){void 0===e&&(e=ee(n));var i=1<<((0===t?e:e>>>t)&cr),o=this.bitmap;return 0===(o&i)?r:this.nodes[an(o&i-1)].get(t+ar,e,n,r)},Ue.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=ee(r));var a=(0===e?n:n>>>e)&cr,s=1<<a,c=this.bitmap,f=0!==(c&s);if(!f&&i===fr)return this;var l=an(c&s-1),h=this.nodes,p=f?h[l]:void 0,_=Ye(p,t,e+ar,n,r,i,o,u);if(_===p)return this;if(!f&&_&&h.length>=Pr)return en(t,h,c,a,_);if(f&&!_&&2===h.length&&Xe(h[1^l]))return h[1^l];if(f&&_&&1===h.length&&Xe(_))return _;var v=t&&t===this.ownerID,y=f?_?c:c^s:c|s,d=f?_?sn(h,l,_,v):fn(h,l,v):cn(h,l,_,v);return v?(this.bitmap=y,this.nodes=d,this):new Ue(t,y,d)},We.prototype.get=function(t,e,n,r){void 0===e&&(e=ee(n));var i=(0===t?e:e>>>t)&cr,o=this.nodes[i];return o?o.get(t+ar,e,n,r):r},We.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=ee(r));var a=(0===e?n:n>>>e)&cr,s=i===fr,c=this.nodes,f=c[a];if(s&&!f)return this;var l=Ye(f,t,e+ar,n,r,i,o,u);if(l===f)return this;var h=this.count;if(f){if(!l&&(h--,qr>h))return tn(t,c,h,a)}else h++;var p=t&&t===this.ownerID,_=sn(c,a,l,p);return p?(this.count=h,this.nodes=_,this):new We(t,h,_)},Ve.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(J(n,i[o][0]))return i[o][1];return r},Ve.prototype.update=function(t,e,r,o,u,a,s){void 0===r&&(r=ee(o));var c=u===fr;if(r!==this.keyHash)return c?this:(n(s),n(a),Ze(this,t,e,r,[o,u]));for(var f=this.entries,l=0,h=f.length;h>l&&!J(o,f[l][0]);l++);var p=h>l;if(p?f[l][1]===u:c)return this;if(n(s),(c||!p)&&n(a),c&&2===h)return new Ge(t,this.keyHash,f[1^l]);var _=t&&t===this.ownerID,v=_?f:i(f);return p?c?l===h-1?v.pop():v[l]=v.pop():v[l]=[o,u]:v.push([o,u]),_?(this.entries=v,this):new Line truncated
e[o]=t[o]}return e}function _n(t,e){for(var n=-1,r=e.length;++n<r;){var i=e[n];t[i]=cr(t[i],N,t)}return t}function vn(t,e,n){var r=typeof t;return"function"==r?"undefined"!=typeof e&&wr(t)?Yn(t,e,n):t:null==t?Tu:"object"==r?Ln(t):qn(t+"")}function yn(t,e,n,r,i,o,u){var a;if(n&&(a=i?n(t,r,i):n(t)),"undefined"!=typeof a)return a;if(!To(t))return t;var s=Va(t);if(s){if(a=dr(t),!e)return Ye(t,a)}else{var c=Bu.call(t),f=c==X;if(c!=te&&c!=H&&(!f||i))return We[c]?mr(t,c,e):i?t:{};if(a=gr(f?{}:t),!e)return pn(t,a,Ha(t))}o||(o=[]),u||(u=[]);for(var l=o.length;l--;)if(o[l]==t)return u[l];return o.push(t),u.push(a),(s?Xe:Nn)(t,function(r,i){a[i]=yn(r,e,n,i,t,o,u)}),a}function dn(t,e,n,r){if(!wo(t))throw new Uu(K);return ua(function(){t.apply(S,Gn(n,r))},e)}function gn(t,e){var n=t?t.length:0,r=[];if(!n)return r;var i=-1,o=vr(),a=o==u,s=a&&e.length>=200&&Ma(e),c=e.length;s&&(o=Fe,a=!1,e=s);t:for(;++i<n;){var f=t[i];if(a&&f===f){for(var l=c;l--;)if(e[l]===f)continue t;r.push(f)}else o(e,f)<0&&r.push(f)}return r}function mn(t,e){var n=t?t.length:0;if(!Er(n))return Nn(t,e);for(var r=-1,i=Mr(t);++r<n&&e(i[r],r,i)!==!1;);return t}function wn(t,e){var n=t?t.length:0;if(!Er(n))return Cn(t,e);for(var r=Mr(t);n--&&e(r[n],n,r)!==!1;);return t}function Tn(t,e){var n=!0;return mn(t,function(t,r,i){return n=!!e(t,r,i)}),n}function bn(t,e){var n=[];return mn(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function En(t,e,n,r){var i;return n(t,function(t,n,o){return e(t,n,o)?(i=r?n:t,!1):void 0}),i}function On(t,e,n,r){for(var i=(r||0)-1,o=t.length,u=-1,a=[];++i<o;){var s=t[i];if(g(s)&&Er(s.length)&&(Va(s)||ho(s))){e&&(s=On(s,e,n));var c=-1,f=s.length;for(a.length+=f;++c<f;)a[++u]=s[c]}else n||(a[++u]=s)}return a}function In(t,e,n){for(var r=-1,i=Mr(t),o=n(t),u=o.length;++r<u;){var a=o[r];if(e(i[a],a,i)===!1)break}return t}function Sn(t,e,n){for(var r=Mr(t),i=n(t),o=i.length;o--;){var u=i[o];if(e(r[u],u,r)===!1)break}return t}function An(t,e){return In(t,e,Ko)}function Nn(t,e){return In(t,e,Ha)}function Cn(t,e){return Sn(t,e,Ha)}function Dn(t,e){for(var n=-1,r=e.length,i=-1,o=[];++n<r;){var u=e[n];wo(t[u])&&(o[++i]=u)}return o}function xn(t,e,n){var r=-1,i="function"==typeof e,o=t?t.length:0,u=Er(o)?xu(o):[];return mn(t,function(t){var o=i?e:null!=t&&t[e];u[++r]=o?o.apply(t,n):S}),u}function Mn(t,e,n,r,i,o){if(t===e)return 0!==t||1/t==1/e;var u=typeof t,a=typeof e;return"function"!=u&&"object"!=u&&"function"!=a&&"object"!=a||null==t||null==e?t!==t&&e!==e:Rn(t,e,Mn,n,r,i,o)}function Rn(t,e,n,r,i,o,u){var a=Va(t),s=Va(e),c=F,f=F;a||(c=Bu.call(t),c==H?c=te:c!=te&&(a=Co(t))),s||(f=Bu.call(e),f==H?f=te:f!=te&&(s=Co(e)));var l=c==te,h=f==te,p=c==f;if(p&&!a&&!l)return lr(t,e,c);var _=l&&Hu.call(t,"__wrapped__"),v=h&&Hu.call(e,"__wrapped__");if(_||v)return n(_?t.value():t,v?e.value():e,r,i,o,u);if(!p)return!1;o||(o=[]),u||(u=[]);for(var y=o.length;y--;)if(o[y]==t)return u[y]==e;o.push(t),u.push(e);var d=(a?fr:hr)(t,e,n,r,i,o,u);return o.pop(),u.pop(),d}function kn(t,e,n,r,i){var o=e.length;if(null==t)return!o;for(var u=-1,a=!i;++u<o;)if(a&&r[u]?n[u]!==t[e[u]]:!Hu.call(t,e[u]))return!1;for(u=-1;++u<o;){var s=e[u];if(a&&r[u])var c=Hu.call(t,s);else{var f=t[s],l=n[u];c=i?i(f,l,s):S,"undefined"==typeof c&&(c=Mn(l,f,i,!0))}if(!c)return!1}return!0}function jn(t,e){var n=[];return mn(t,function(t,r,i){n.push(e(t,r,i))}),n}function Ln(t){var e=Ha(t),n=e.length;if(1==n){var r=e[0],i=t[r];if(Or(i))return function(t){return null!=t&&i===t[r]&&Hu.call(t,r)}}for(var o=xu(n),u=xu(n);n--;)i=t[e[n]],o[n]=i,u[n]=Or(i);return function(t){return kn(t,e,o,u)}}function zn(t,e,n,r,i){var o=Er(e.length)&&(Va(e)||Co(e));return(o?Xe:Nn)(e,function(e,u,a){if(g(e))return r||(r=[]),i||(i=[]),Pn(t,a,u,zn,n,r,i);var s=t[u],c=n?n(s,e,u,t,a):S,f="undefined"==typeof c;f&&(c=e),!o&&"undefined"==typeof c||!f&&(c===c?c===s:s!==s)||(t[u]=c)}),t}function Pn(t,e,n,r,i,o,u){for(var a=o.length,s=e[n];a--;)if(o[a]==s)return void(t[n]=u[a]);var c=t[n],f=i?i(c,s,n,t,e):S,l="undefined"==typeof f;l&&(f=s,Er(s.length)&&(Va(s)||Co(s))?f=Va(c)?c:c?Ye(c):[]:Ka(s)||ho(s)?f=ho(c)?Mo(c):Ka(c)?c:{}:l=!1),o.push(s),u.push(f),l?t[n]=r(f,s,i,o,u):(f===f?f!==c:c===c)&&(t[n]=f)}function qn(t){return function(e){return null==e?S:e[t]}}function Un(t,e){var n=e.length,r=hn(t,e);for(e.sort(o);n--;){var i=parseFloat(e[n]);if(i!=u&&Tr(i)){var u=i;aa.call(t,i,1)}}return r}function Wn(t,e){return t+ea(wa()*(e-t+1))}function Vn(t,e,n,r,i){return i(t,function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)}),n}function Gn(t,e,n){var r=-1,i=t.length;e=null==e?0:+e||0,0>e&&(e=-e>i?0:i+e),n="undefined"==typeof n||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=xu(i);++r<i;)o[r]=t[r+e];return o}function Kn(t,e){var n;return mn(t,function(t,r,i){return n=e(t,r,i),!n}),!!n}function $n(t,e){var n=-1,r=vr(),i=t.length,o=r==u,a=o&&i>=200,s=a&&Ma(),c=[];s?(r=Fe,o=!1):(a=!1,s=e?[]:c);t:for(;++n<i;){var f=t[n],l=e?e(f,n,t):f;if(o&&f===f){for(var h=s.length;h--;)if(s[h]===l)continue t;e&&s.push(l),c.push(f)}else r(s,l)<0&&((e||a)&&s.pLine truncated
if(e=i,o>0){if(++t>=q)return n}else t=0;return xa(n,r)}}(),ja=tr(function(t,e,n){Hu.call(t,n)?++t[n]:t[n]=1}),La=tr(function(t,e,n){Hu.call(t,n)?t[n].push(e):t[n]=[e]}),za=tr(function(t,e,n){t[n]=e}),Pa=or(rn),qa=or(on,!0),Ua=tr(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),Wa=da||function(){return(new Mu).getTime()},Va=la||function(t){return g(t)&&Er(t.length)&&Bu.call(t)==F||!1};Ca.dom||(vo=function(t){return t&&1===t.nodeType&&g(t)&&!Ka(t)||!1});var Ga=ga||function(t){return"number"==typeof t&&pa(t)};(wo(/x/)||sa&&!wo(sa))&&(wo=function(t){return Bu.call(t)==X});var Ka=na?function(t){if(!t||Bu.call(t)!=te)return!1;var e=t.valueOf,n=Oo(e)&&(n=na(e))&&na(n);return n?t==n||na(t)==n:Cr(t)}:Cr,$a=er(ln),Ha=_a?function(t){if(t)var e=t.constructor,n=t.length;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&n&&Er(n)?Dr(t):To(t)?_a(t):[]}:Dr,Fa=er(zn),Ba=rr(function(t,e,n){return e=e.toLowerCase(),t+(n?e.charAt(0).toUpperCase()+e.slice(1):e)}),Ja=rr(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()});8!=ma(ze+"08")&&(su=function(t,e,n){return(n?br(t,e,n):null==e)?e=0:e&&(e=+e),t=hu(t),ma(t,e||(Ne.test(t)?16:10))});var Ya=rr(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Xa=rr(function(t,e,n){return t+(n?" ":"")+(e.charAt(0).toUpperCase()+e.slice(1))});return n.prototype=e.prototype,ne.prototype["delete"]=ie,ne.prototype.get=Ge,ne.prototype.has=Ke,ne.prototype.set=$e,He.prototype.push=Je,no.Cache=ne,e.after=Gi,e.ary=Ki,e.assign=$a,e.at=Ti,e.before=$i,e.bind=Hi,e.bindAll=Fi,e.bindKey=Bi,e.callback=mu,e.chain=_i,e.chunk=Rr,e.compact=kr,e.constant=wu,e.countBy=ja,e.create=Ro,e.curry=Ji,e.curryRight=Yi,e.debounce=Xi,e.defaults=ko,e.defer=Zi,e.delay=Qi,e.difference=jr,e.drop=Lr,e.dropRight=zr,e.dropRightWhile=Pr,e.dropWhile=qr,e.filter=Oi,e.flatten=Gr,e.flattenDeep=Kr,e.flow=to,e.flowRight=eo,e.forEach=Ni,e.forEachRight=Ci,e.forIn=zo,e.forInRight=Po,e.forOwn=qo,e.forOwnRight=Uo,e.functions=Wo,e.groupBy=La,e.indexBy=za,e.initial=Hr,e.intersection=Fr,e.invert=Go,e.invoke=Di,e.keys=Ha,e.keysIn=Ko,e.map=xi,e.mapValues=$o,e.matches=bu,e.memoize=no,e.merge=Fa,e.mixin=Eu,e.negate=ro,e.omit=Ho,e.once=io,e.pairs=Fo,e.partial=oo,e.partialRight=uo,e.partition=Ua,e.pick=Bo,e.pluck=Mi,e.property=Su,e.propertyOf=Au,e.pull=Yr,e.pullAt=Xr,e.range=Nu,e.rearg=ao,e.reject=ji,e.remove=Zr,e.rest=Qr,e.shuffle=zi,e.slice=ti,e.sortBy=Ui,e.sortByAll=Wi,e.take=ri,e.takeRight=ii,e.takeRightWhile=oi,e.takeWhile=ui,e.tap=vi,e.throttle=so,e.thru=yi,e.times=Cu,e.toArray=xo,e.toPlainObject=Mo,e.transform=Yo,e.union=ai,e.uniq=si,e.unzip=ci,e.values=Xo,e.valuesIn=Zo,e.where=Vi,e.without=fi,e.wrap=co,e.xor=li,e.zip=hi,e.zipObject=pi,e.backflow=eo,e.collect=xi,e.compose=eo,e.each=Ni,e.eachRight=Ci,e.extend=$a,e.iteratee=mu,e.methods=Wo,e.object=pi,e.select=Oi,e.tail=Qr,e.unique=si,Eu(e,e),e.attempt=gu,e.camelCase=Ba,e.capitalize=tu,e.clone=fo,e.cloneDeep=lo,e.deburr=eu,e.endsWith=nu,e.escape=ru,e.escapeRegExp=iu,e.every=Ei,e.find=Ii,e.findIndex=Ur,e.findKey=jo,e.findLast=Si,e.findLastIndex=Wr,e.findLastKey=Lo,e.findWhere=Ai,e.first=Vr,e.has=Vo,e.identity=Tu,e.includes=bi,e.indexOf=$r,e.isArguments=ho,e.isArray=Va,e.isBoolean=po,e.isDate=_o,e.isElement=vo,e.isEmpty=yo,e.isEqual=go,e.isError=mo,e.isFinite=Ga,e.isFunction=wo,e.isMatch=bo,e.isNaN=Eo,e.isNative=Oo,e.isNull=Io,e.isNumber=So,e.isObject=To,e.isPlainObject=Ka,e.isRegExp=Ao,e.isString=No,e.isTypedArray=Co,e.isUndefined=Do,e.kebabCase=Ja,e.last=Br,e.lastIndexOf=Jr,e.max=Pa,e.min=qa,e.noConflict=Ou,e.noop=Iu,e.now=Wa,e.pad=ou,e.padLeft=uu,e.padRight=au,e.parseInt=su,e.random=Qo,e.reduce=Ri,e.reduceRight=ki,e.repeat=cu,e.result=Jo,e.runInContext=I,e.size=Pi,e.snakeCase=Ya,e.some=qi,e.sortedIndex=ei,e.sortedLastIndex=ni,e.startCase=Xa,e.startsWith=fu,e.template=lu,e.trim=hu,e.trimLeft=pu,e.trimRight=_u,e.trunc=vu,e.unescape=yu,e.uniqueId=Du,e.words=du,e.all=Ei,e.any=qi,e.contains=bi,e.detect=Ii,e.foldl=Ri,e.foldr=ki,e.head=Vr,e.include=bi,e.inject=Ri,Eu(e,function(){var t={};return Nn(e,function(n,r){e.prototype[r]||(t[r]=n)}),t}(),!1),e.sample=Li,e.prototype.sample=function(t){return this.__chain__||null!=t?this.thru(function(e){return Li(e,t)}):Li(this.value())},e.VERSION=A,Xe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){e[t].placeholder=e}),Xe(["filter","map","takeWhile"],function(t,e){var n=e==W;r.prototype[t]=function(t,r){var i=this.clone(),o=i.filtered,u=i.iteratees||(i.iteratees=[]);return i.filtered=o||n||e==G&&i.dir<0,u.push({iteratee:_r(t,r,3),type:e}),i}}),Xe(["drop","take"],function(t,e){var n=t+"Count",i=t+"While";r.prototype[t]=function(r){r=null==r?1:va(+r||0,0);var i=this.clone();if(i.filtered){var o=i[n];i[n]=e?ya(o,r):o+r}else{var u=i.views||(i.views=[]);u.push({size:r,type:t+(i.dir<0?"Right":"")})}return i},r.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()},r.prototype[t+"RightWhile"]=function(t,e){return this.reverse()[i](t,e).reverse()}}),Xe(["first","last"],function(t,e){var n="takeLine truncated
},!1),p.addEventListener("message",function(t){v(),"ping"!==t.data&&c.dispatch({actionType:f.ACTION_REMOTE_EVENT_RECEIVED,event:JSON.parse(t.data)})},!1),p.addEventListener("error",function(){p.readyState!==EventSource.CLOSED&&c.dispatch({actionType:f.ACTION_STREAM_ERROR})},!1)}function o(){y(),c.dispatch({actionType:f.ACTION_STREAM_STOP}),l.start()}var u=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t){return t&&t.__esModule?t["default"]:t};e.isSupported=r,e.start=i,e.stop=o;var s=a(n(6)),c=a(n(1)),f=a(n(2)),l=u(n(13)),h=6e4,p=null,_=null,v=s.debounce(function(){i(_)},h),y=function(){p.close(),p=null,_=null,v.cancel()};Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t,e){var n=e.useStreaming,r=void 0===n?l.isSupported:n,i=e.rememberLogin,o=void 0===i?!1:i;s.dispatch({actionType:c.ACTION_VALIDATING_AUTH_TOKEN}),a("GET","",!1,{authToken:t}).then(function(){s.dispatch({actionType:c.ACTION_VALID_AUTH_TOKEN,authToken:t,rememberLogin:o}),r?l.start(t):f.start()},function(t){s.dispatch({actionType:c.ACTION_INVALID_AUTH_TOKEN,message:t.message})})}function i(){s.dispatch({actionType:c.ACTION_LOG_OUT})}var o=function(t){return t&&t.__esModule?t:{"default":t}},u=function(t){return t&&t.__esModule?t["default"]:t};e.validate=r,e.logOut=i;var a=u(n(5)),s=u(n(1)),c=u(n(2)),f=o(n(13)),l=o(n(27));Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t){a.dispatch({actionType:s.ACTION_NEW_LOGBOOK,logbookEntries:t})}function i(){u("GET","logbook").then(r)}var o=function(t){return t&&t.__esModule?t["default"]:t};e.fetch=i;var u=o(n(5)),a=o(n(1)),s=o(n(2));Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t,e){(t||e.length>0)&&s.dispatch({actionType:c.ACTION_NEW_STATE_HISTORY,stateHistory:e.map(function(t){return t.map(f.fromJSON)}),isFetchAll:t})}function i(){a("GET","history/period").then(function(t){return r(!0,t)})}function o(t){a("GET","history/period?filter_entity_id="+t).then(function(t){return r(!1,t)})}var u=function(t){return t&&t.__esModule?t["default"]:t};e.fetchAll=i,e.fetch=o;var a=u(n(5)),s=u(n(1)),c=u(n(2)),f=u(n(14));Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(){return"webkitSpeechRecognition"in window}function i(){var t=v||_;c.dispatch({actionType:f.ACTION_LISTENING_TRANSMITTING,finalTranscript:t}),l("conversation","process",{text:t}).then(function(){c.dispatch({actionType:f.ACTION_LISTENING_DONE,finalTranscript:t})},function(){c.dispatch({actionType:f.ACTION_LISTENING_ERROR})})}function o(){null!==p&&(p.onstart=null,p.onresult=null,p.onerror=null,p.onend=null,p.stop(),p=null,i()),_="",v=""}function u(){o(),window.r=p=new webkitSpeechRecognition,p.interimResults=!0,p.onstart=function(){c.dispatch({actionType:f.ACTION_LISTENING_START})},p.onresult=function(t){_="";for(var e=t.resultIndex;e<t.results.length;++e)t.results[e].isFinal?v+=t.results[e][0].transcript:_+=t.results[e][0].transcript;c.dispatch({actionType:f.ACTION_LISTENING_RESULT,interimTranscript:_,finalTranscript:v}),y()},p.onerror=function(){c.dispatch({actionType:f.ACTION_LISTENING_ERROR})},p.onend=o,p.start()}var a=function(t){return t&&t.__esModule?t["default"]:t};e.isSupported=r,e.stop=o,e.listen=u;var s=a(n(6)),c=a(n(1)),f=a(n(2)),l=n(11).callService,h=3e3,p=null,_="",v="",y=s.debounce(o,h);Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t){var e=[];u.forEach(function(n,r){if(this[n]){var i=a[r],o=this[n].bind(this,i);i.addChangeListener(o),e.push({store:i,listener:o}),t&&o()}}.bind(this)),this._storeListeners=e}function i(){this._storeListeners.forEach(function(t){var e=t.store,n=t.listener;e.removeChangeListener(n)})}e.listenToStores=r,e.stopListeningToStores=i;var o=["auth","component","event","service","state","stateHistory","stream","sync","notification","voice","logbook"],u=o.map(function(t){return t+"StoreChanged"}),a=o.map(function(t){var e=t.replace(/([A-Z])/g,function(t){return"_"+t.toLowerCase()});return n(40)("./"+e)});Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";var r=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},i=function l(t,e,n){var r=Object.getOwnPropertyDescriptor(t,e);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:l(i,e,n)}if("value"in r&&r.writable)return r.value;var o=r.get;return void 0===o?void 0:o.call(n)},o=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=n(4).Record,s=n(24).parseDateTime,c=new a({when:null,name:null,message:null,domain:null,entityId:null},"LogbookEntry"),f=function(t){functioLine truncated
<div hidden><style>html /deep/ core-label{cursor:default}</style><polymer-element name="core-label" assetpath="polymer/bower_components/core-label/"><script>(function(){var ID=0;function generate(node){if(!node.id){node.id="core-label-"+ID++}return node.id}Polymer("core-label",{publish:{"for":{reflect:true,value:""}},eventDelegates:{tap:"tapHandler"},created:function(){generate(this);this._forElement=null},ready:function(){if(!this.for){this._forElement=this.querySelector("[for]");this._tie()}},tapHandler:function(ev){if(!this._forElement){return}if(ev.target===this._forElement){return}this._forElement.focus();this._forElement.click();this.fire("tap",null,this._forElement)},_tie:function(){if(this._forElement){this._forElement.setAttribute("aria-labelledby",this.id)}},_findScope:function(){var n=this.parentNode;while(n&&n.parentNode){n=n.parentNode}return n},forChanged:function(oldFor,newFor){if(this._forElement){this._forElement.removeAttribute("aria-labelledby")}var scope=this._findScope();if(!scope){return}this._forElement=scope.querySelector(newFor);if(this._forElement){this._tie()}}})})();</script></polymer-element><polymer-element name="paper-ripple" attributes="initialOpacity opacityDecayVelocity" assetpath="polymer/bower_components/paper-ripple/"><template><style>:host{display:block;position:relative;border-radius:inherit;overflow:hidden}:host-context([noink]){pointer-events:none}#bg,#waves,.wave-container,.wave{pointer-events:none;position:absolute;top:0;left:0;width:100%;height:100%}#bg,.wave{opacity:0}#waves,.wave{overflow:hidden}.wave-container,.wave{border-radius:50%}:host(.circle) #bg,:host(.circle) #waves{border-radius:50%}:host(.circle) .wave-container{overflow:hidden}</style><div id="bg"></div><div id="waves"></div></template><script>(function(){var waveMaxRadius=150;function waveRadiusFn(touchDownMs,touchUpMs,anim){var touchDown=touchDownMs/1e3;var touchUp=touchUpMs/1e3;var totalElapsed=touchDown+touchUp;var ww=anim.width,hh=anim.height;var waveRadius=Math.min(Math.sqrt(ww*ww+hh*hh),waveMaxRadius)*1.1+5;var duration=1.1-.2*(waveRadius/waveMaxRadius);var tt=totalElapsed/duration;var size=waveRadius*(1-Math.pow(80,-tt));return Math.abs(size)}function waveOpacityFn(td,tu,anim){var touchDown=td/1e3;var touchUp=tu/1e3;var totalElapsed=touchDown+touchUp;if(tu<=0){return anim.initialOpacity}return Math.max(0,anim.initialOpacity-touchUp*anim.opacityDecayVelocity)}function waveOuterOpacityFn(td,tu,anim){var touchDown=td/1e3;var touchUp=tu/1e3;var outerOpacity=touchDown*.3;var waveOpacity=waveOpacityFn(td,tu,anim);return Math.max(0,Math.min(outerOpacity,waveOpacity))}function waveDidFinish(wave,radius,anim){var waveOpacity=waveOpacityFn(wave.tDown,wave.tUp,anim);return waveOpacity<.01&&radius>=Math.min(wave.maxRadius,waveMaxRadius)}function waveAtMaximum(wave,radius,anim){var waveOpacity=waveOpacityFn(wave.tDown,wave.tUp,anim);return waveOpacity>=anim.initialOpacity&&radius>=Math.min(wave.maxRadius,waveMaxRadius)}function drawRipple(ctx,x,y,radius,innerAlpha,outerAlpha){if(outerAlpha!==undefined){ctx.bg.style.opacity=outerAlpha}ctx.wave.style.opacity=innerAlpha;var s=radius/(ctx.containerSize/2);var dx=x-ctx.containerWidth/2;var dy=y-ctx.containerHeight/2;ctx.wc.style.webkitTransform="translate3d("+dx+"px,"+dy+"px,0)";ctx.wc.style.transform="translate3d("+dx+"px,"+dy+"px,0)";ctx.wave.style.webkitTransform="scale("+s+","+s+")";ctx.wave.style.transform="scale3d("+s+","+s+",1)"}function createWave(elem){var elementStyle=window.getComputedStyle(elem);var fgColor=elementStyle.color;var inner=document.createElement("div");inner.style.backgroundColor=fgColor;inner.classList.add("wave");var outer=document.createElement("div");outer.classList.add("wave-container");outer.appendChild(inner);var container=elem.$.waves;container.appendChild(outer);elem.$.bg.style.backgroundColor=fgColor;var wave={bg:elem.$.bg,wc:outer,wave:inner,waveColor:fgColor,maxRadius:0,isMouseDown:false,mouseDownStart:0,mouseUpStart:0,tDown:0,tUp:0};return wave}function removeWaveFromScope(scope,wave){if(scope.waves){var pos=scope.waves.indexOf(wave);scope.waves.splice(pos,1);wave.wc.remove()}}var pow=Math.pow;var now=Date.now;if(window.performance&&performance.now){now=performance.now.bind(performance)}function cssColorWithAlpha(cssColor,alpha){var parts=cssColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(typeof alpha=="undefined"){alpha=1}if(!parts){return"rgba(255, 255, 255, "+alpha+")"}return"rgba("+parts[1]+", "+parts[2]+", "+parts[3]+", "+alpha+")"}function dist(p1,p2){return Math.sqrt(pow(p1.x-p2.x,2)+pow(p1.y-p2.y,2))}function distanceFromPointToFurthestCorner(point,size){var tl_d=dist(point,{x:0,y:0});var tr_d=dist(point,{x:size.w,y:0});var bl_d=dist(point,{x:0,y:size.h});var br_d=dist(point,{x:size.w,y:size.h});return Math.max(tl_d,tr_d,bl_d,br_d)}Polymer("paper-ripple",{initialOpacity:.25,opacityDecayVelocity:.8,backgroundFill:true,pixelDensity:2,eventDelegates:{down:"downAction",up:"upAction"},ready:function(){this.waves=[]}Line truncated
.label-text,
.error {
color: {{g.paperInput.labelColor}};
}
::-webkit-input-placeholder {
color: {{g.paperInput.labelColor}};
}
::-moz-placeholder {
color: {{g.paperInput.labelColor}};
}
:-ms-input-placeholder {
color: {{g.paperInput.labelColor}};
}
.unfocused-underline {
background-color: {{g.paperInput.labelColor}};
}
:host([focused]) .floated-label .label-text {
color: {{g.paperInput.focusedColor}};
}
.focused-underline {
background-color: {{g.paperInput.focusedColor}};
}
:host(.invalid) .floated-label .label-text,
.error {
color: {{g.paperInput.invalidColor}};
}
:host(.invalid) .unfocused-underline,
:host(.invalid) .focused-underline {
background-color: {{g.paperInput.invalidColor}};
}
</core-style><polymer-element name="paper-input-decorator" layout="" vertical="" on-transitionend="{{transitionEndAction}}" on-webkittransitionend="{{transitionEndAction}}" on-input="{{inputAction}}" on-down="{{downAction}}" on-tap="{{tapAction}}" on-char-counter-error="{{charCounterErrorAction}}" assetpath="polymer/bower_components/paper-input/"><template><style>:host{display:inline-block;outline:0;text-align:inherit;padding:.75em 0}polyfill-next-selector{content:'.input-body > :not(.label)'}::content>*,::content>input[is=core-input]{padding:0;margin:.5em 0 .25em;width:100%}polyfill-next-selector{content:'input, textarea'}::content input,::content input[is=core-input],::content textarea{font:inherit;color:inherit;background-color:transparent;border:none;outline:0}polyfill-next-selector{content:':invalid'}::content input:invalid,::content textarea:invalid{box-shadow:none}polyfill-next-selector{content:'textarea'}::content textarea{resize:none}[invisible]{visibility:hidden}[animated]{visibility:visible!important;-webkit-transition:-webkit-transform .2s cubic-bezier(0.4,0,.2,1),opacity .2s cubic-bezier(0.4,0,.2,1);transition:transform .2s cubic-bezier(0.4,0,.2,1),opacity .2s cubic-bezier(0.4,0,.2,1)}.floated-label{font-size:.75em;background:0 0;white-space:nowrap}.mirror-text{padding:.5em 0 .25em;max-width:100%;white-space:nowrap}:host([multiline]) .mirror-text{white-space:pre-wrap;word-wrap:break-word}.label{padding:.5em 0 .25em;background:0 0;pointer-events:none}.label-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;max-width:100%;-moz-transform-origin:0 0;-webkit-transform-origin:0 0;transform-origin:0 0}.underline{height:0;overflow:visible}:host([disabled]) .underline{border-bottom:1px dashed #757575}.unfocused-underline{height:1px}.focused-underline{height:2px;-webkit-transform:none;transform:none}.focused-underline[invisible]{-webkit-transform:scale3d(0,1,1);transform:scale3d(0,1,1)}.error-text{font-size:.75em;padding:.5em 0}.error-icon{height:20px;width:20px}</style><core-style ref="paper-input-decorator"></core-style><div class="floated-label" aria-hidden="true" hidden?="{{!floatingLabel}}" invisible?="{{!floatingLabelVisible || labelAnimated}}"><span id="floatedLabelText" class="label-text">{{label}}</span></div><div class="input-body" flex="" auto="" relative=""><div class="label" fit="" invisible="" aria-hidden="true"><span id="labelText" class="label-text" invisible?="{{!_labelVisible}}" animated?="{{labelAnimated}}">{{label}}</span></div><content select="*:not(.counter)"></content></div><div id="underline" class="underline" relative=""><div class="unfocused-underline" fit="" invisible?="{{disabled}}"></div><div id="focusedUnderline" class="focused-underline" fit="" invisible?="{{!underlineVisible}}" animated?="{{underlineAnimated}}"></div></div><div class="footer" layout="" horizontal="" end-justified=""><div class="error" flex="" layout="" horizontal="" center="" hidden?="{{!isInvalid}}"><div class="error-text" flex="" auto="" role="alert" aria-hidden="{{!isInvalid}}">{{error}}</div><core-icon id="errorIcon" class="error-icon" icon="warning"></core-icon></div><div aria-hidden="true"><content select=".counter"></content></div></div></template><script>(function(){var paperInput=CoreStyle.g.paperInput=CoreStyle.g.paperInput||{};paperInput.labelColor="#757575";paperInput.focusedColor="#4059a9";paperInput.invalidColor="#d34336";Polymer("paper-input-decorator",{publish:{label:"",floatingLabel:false,disabled:{value:false,reflect:true},labelVisible:null,isInvalid:false,autoValidate:false,error:"",focused:{value:false,reflect:true}},computed:{floatingLabelVisible:"floatingLabel && !_labelVisible",_labelVisible:"(labelVisible === true || labelVisible === false) ? labelVisible : _autoLabelVisible"},ready:function(){Polymer.addEventListener(this,"focus",this.focusAction.bind(this),true);Polymer.addEventListener(this,"blur",this.blurAction.bind(this),true)},attached:function(){this.input=this.querySelector("input,textarea");this.mo=new MutationObserver(function(){this.input=this.querySelector("input,textarea")}.bind(this));this.mo.observe(this,{childList:true})},detached:function(){this.mo.disconnect();this.mo=null},prepareLabelTransform:function(){var toRect=this.$.floatedLabelText.getBoundingClientRect();var fromRect=this.$.labelText.getBoundingClientRect();if(toRect.width!==0){var sy=toRect.height/fromRect.height;this.$.labelText.cachedTransform="scale3d("+toRect.width/fromRect.width+","+sy+",1) "+"translate3d(0,"+(toRect.top-fromRect.top)/sy+"px,0)"}},animateFloatingLabel:function(){if(!this.floatingLabel||this.labelAnimated){return false}if(!this.$.labelText.cachedTransform){this.prepareLabelTransform()}if(!this.$.labelText.cachedTransform){return false}this.labelAnimated=true;this.async(function(){this.transitionEndAction()},null,250);if(this._labelVisible){if(!this.$.labelText.style.webkitTransform&&!this.$.labelText.style.transform){this.$.labelText.style.webkitTrLine truncated
Remember
</core-label><paper-button on-click="{{validatePassword}}">Log In</paper-button></div></div><div id="validatebox" hidden?="{{!(isValidating || isLoggedIn)}}"><paper-spinner active="true"></paper-spinner><br><div class="validatemessage">{{spinnerMessage}}</div></div></div></div></div></template><script>var storeListenerMixIn=window.hass.storeListenerMixIn;var uiActions=window.hass.uiActions;Polymer(Polymer.mixin({MSG_VALIDATING:"Validating password…",MSG_LOADING_DATA:"Loading data…",authToken:"",rememberLogin:false,isValidating:false,isLoggedIn:false,spinnerMessage:"",attached:function(){this.focusPassword();this.listenToStores(true)},detached:function(){this.stopListeningToStores()},authStoreChanged:function(authStore){this.isValidating=authStore.isValidating;this.isLoggedIn=authStore.isLoggedIn;this.spinnerMessage=this.isValidating?this.MSG_VALIDATING:this.MSG_LOADING_DATA;if(authStore.lastAttemptInvalid){this.$.passwordDecorator.error=authStore.lastAttemptMessage;this.$.passwordDecorator.isInvalid=true}if(!(this.isValidating&&this.isLoggedIn)){this.job("focusPasswordBox",this.focusPassword.bind(this))}},focusPassword:function(){this.$.passwordInput.focus()},passwordKeyup:function(ev){if(ev.keyCode===13){this.validatePassword()}else if(this.$.passwordDecorator.isInvalid){this.$.passwordDecorator.isInvalid=false}},validatePassword:function(){this.$.hideKeyboardOnFocus.focus();uiActions.validateAuth(this.authToken,this.rememberLogin)}},storeListenerMixIn));</script></polymer-element></div>
<div hidden><polymer-element name="core-media-query" attributes="query queryMatches" assetpath="polymer/bower_components/core-media-query/"><template><style>:host{display:none}</style></template><script>Polymer("core-media-query",{queryMatches:false,query:"",ready:function(){this._mqHandler=this.queryHandler.bind(this);this._mq=null},queryChanged:function(){if(this._mq){this._mq.removeListener(this._mqHandler)}var query=this.query;if(query[0]!=="("){query="("+this.query+")"}this._mq=window.matchMedia(query);this._mq.addListener(this._mqHandler);this.queryHandler(this._mq)},queryHandler:function(mq){this.queryMatches=mq.matches;this.asyncFire("core-media-change",mq)}});</script></polymer-element><polymer-element name="core-selection" attributes="multi" hidden assetpath="polymer/bower_components/core-selection/"><script>Polymer("core-selection",{multi:false,ready:function(){this.clear()},clear:function(){this.selection=[]},getSelection:function(){return this.multi?this.selection:this.selection[0]},isSelected:function(item){return this.selection.indexOf(item)>=0},setItemSelected:function(item,isSelected){if(item!==undefined&&item!==null){if(isSelected){this.selection.push(item)}else{var i=this.selection.indexOf(item);if(i>=0){this.selection.splice(i,1)}}this.fire("core-select",{isSelected:isSelected,item:item})}},select:function(item){if(this.multi){this.toggle(item)}else if(this.getSelection()!==item){this.setItemSelected(this.getSelection(),false);this.setItemSelected(item,true)}},toggle:function(item){this.setItemSelected(item,!this.isSelected(item))}});</script></polymer-element><polymer-element name="core-selector" attributes="selected multi valueattr selectedClass selectedProperty selectedAttribute selectedItem selectedModel selectedIndex notap excludedLocalNames target itemsSelector activateEvent" assetpath="polymer/bower_components/core-selector/"><template><core-selection id="selection" multi="{{multi}}" on-core-select="{{selectionSelect}}"></core-selection><content id="items" select="*"></content></template><script>Polymer("core-selector",{selected:null,multi:false,valueattr:"name",selectedClass:"core-selected",selectedProperty:"",selectedAttribute:"active",selectedItem:null,selectedModel:null,selectedIndex:-1,excludedLocalNames:"",target:null,itemsSelector:"",activateEvent:"tap",notap:false,defaultExcludedLocalNames:"template",observe:{"selected multi":"selectedChanged"},ready:function(){this.activateListener=this.activateHandler.bind(this);this.itemFilter=this.filterItem.bind(this);this.excludedLocalNamesChanged();this.observer=new MutationObserver(this.updateSelected.bind(this));if(!this.target){this.target=this}},get items(){if(!this.target){return[]}var nodes=this.target!==this?this.itemsSelector?this.target.querySelectorAll(this.itemsSelector):this.target.children:this.$.items.getDistributedNodes();return Array.prototype.filter.call(nodes,this.itemFilter)},filterItem:function(node){return!this._excludedNames[node.localName]},excludedLocalNamesChanged:function(){this._excludedNames={};var s=this.defaultExcludedLocalNames;if(this.excludedLocalNames){s+=" "+this.excludedLocalNames}s.split(/\s+/g).forEach(function(n){this._excludedNames[n]=1},this)},targetChanged:function(old){if(old){this.removeListener(old);this.observer.disconnect();this.clearSelection()}if(this.target){this.addListener(this.target);this.observer.observe(this.target,{childList:true});this.updateSelected()}},addListener:function(node){Polymer.addEventListener(node,this.activateEvent,this.activateListener)},removeListener:function(node){Polymer.removeEventListener(node,this.activateEvent,this.activateListener)},get selection(){return this.$.selection.getSelection()},selectedChanged:function(){if(arguments.length===1){this.processSplices(arguments[0])}else{this.updateSelected()}},updateSelected:function(){this.validateSelected();if(this.multi){this.clearSelection(this.selected);this.selected&&this.selected.forEach(function(s){this.setValueSelected(s,true)},this)}else{this.valueToSelection(this.selected)}},validateSelected:function(){if(this.multi&&!Array.isArray(this.selected)&&this.selected!=null){this.selected=[this.selected]}else if(!this.multi&&Array.isArray(this.selected)){var s=this.selected[0];this.clearSelection([s]);this.selected=s}},processSplices:function(splices){for(var i=0,splice;splice=splices[i];i++){for(var j=0;j<splice.removed.length;j++){this.setValueSelected(splice.removed[j],false)}for(var j=0;j<splice.addedCount;j++){this.setValueSelected(this.selected[splice.index+j],true)}}},clearSelection:function(excludes){this.$.selection.selection.slice().forEach(function(item){var v=this.valueForNode(item)||this.items.indexOf(item);if(!excludes||excludes.indexOf(v)<0){this.$.selection.setItemSelected(item,false)}},this)},valueToSelection:function(value){var item=this.valueToItem(value);this.$.selection.select(item)},setValueSelected:function(value,isSelected){var item=this.valueToItem(value);if(isSelected^this.$.selectLine truncated
return pickBy("isBefore",args)};moment.max=function(){var args=[].slice.call(arguments,0);return pickBy("isAfter",args)};moment.utc=function(input,format,locale,strict){var c;if(typeof locale==="boolean"){strict=locale;locale=undefined}c={};c._isAMomentObject=true;c._useUTC=true;c._isUTC=true;c._l=locale;c._i=input;c._f=format;c._strict=strict;c._pf=defaultParsingFlags();return makeMoment(c).utc()};moment.unix=function(input){return moment(input*1e3)};moment.duration=function(input,key){var duration=input,match=null,sign,ret,parseIso,diffRes;if(moment.isDuration(input)){duration={ms:input._milliseconds,d:input._days,M:input._months}}else if(typeof input==="number"){duration={};if(key){duration[key]=input}else{duration.milliseconds=input}}else if(!!(match=aspNetTimeSpanJsonRegex.exec(input))){sign=match[1]==="-"?-1:1;duration={y:0,d:toInt(match[DATE])*sign,h:toInt(match[HOUR])*sign,m:toInt(match[MINUTE])*sign,s:toInt(match[SECOND])*sign,ms:toInt(match[MILLISECOND])*sign}}else if(!!(match=isoDurationRegex.exec(input))){sign=match[1]==="-"?-1:1;parseIso=function(inp){var res=inp&&parseFloat(inp.replace(",","."));return(isNaN(res)?0:res)*sign};duration={y:parseIso(match[2]),M:parseIso(match[3]),d:parseIso(match[4]),h:parseIso(match[5]),m:parseIso(match[6]),s:parseIso(match[7]),w:parseIso(match[8])}}else if(duration==null){duration={}}else if(typeof duration==="object"&&("from"in duration||"to"in duration)){diffRes=momentsDifference(moment(duration.from),moment(duration.to));duration={};duration.ms=diffRes.milliseconds;duration.M=diffRes.months}ret=new Duration(duration);if(moment.isDuration(input)&&hasOwnProp(input,"_locale")){ret._locale=input._locale}return ret};moment.version=VERSION;moment.defaultFormat=isoFormat;moment.ISO_8601=function(){};moment.momentProperties=momentProperties;moment.updateOffset=function(){};moment.relativeTimeThreshold=function(threshold,limit){if(relativeTimeThresholds[threshold]===undefined){return false}if(limit===undefined){return relativeTimeThresholds[threshold]}relativeTimeThresholds[threshold]=limit;return true};moment.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",function(key,value){return moment.locale(key,value)});moment.locale=function(key,values){var data;if(key){if(typeof values!=="undefined"){data=moment.defineLocale(key,values)}else{data=moment.localeData(key)}if(data){moment.duration._locale=moment._locale=data}}return moment._locale._abbr};moment.defineLocale=function(name,values){if(values!==null){values.abbr=name;if(!locales[name]){locales[name]=new Locale}locales[name].set(values);moment.locale(name);return locales[name]}else{delete locales[name];return null}};moment.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",function(key){return moment.localeData(key)});moment.localeData=function(key){var locale;if(key&&key._locale&&key._locale._abbr){key=key._locale._abbr}if(!key){return moment._locale}if(!isArray(key)){locale=loadLocale(key);if(locale){return locale}key=[key]}return chooseLocale(key)};moment.isMoment=function(obj){return obj instanceof Moment||obj!=null&&hasOwnProp(obj,"_isAMomentObject")};moment.isDuration=function(obj){return obj instanceof Duration};for(i=lists.length-1;i>=0;--i){makeList(lists[i])}moment.normalizeUnits=function(units){return normalizeUnits(units)};moment.invalid=function(flags){var m=moment.utc(NaN);if(flags!=null){extend(m._pf,flags)}else{m._pf.userInvalidated=true}return m};moment.parseZone=function(){return moment.apply(null,arguments).parseZone()};moment.parseTwoDigitYear=function(input){return toInt(input)+(toInt(input)>68?1900:2e3)};moment.isDate=isDate;extend(moment.fn=Moment.prototype,{clone:function(){return moment(this)},valueOf:function(){return+this._d-(this._offset||0)*6e4},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var m=moment(this).utc();if(0<m.year()&&m.year()<=9999){if("function"===typeof Date.prototype.toISOString){return this.toDate().toISOString()}else{return formatMoment(m,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}}else{return formatMoment(m,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}},toArray:function(){var m=this;return[m.year(),m.month(),m.date(),m.hours(),m.minutes(),m.seconds(),m.milliseconds()]},isValid:function(){return isValid(this)},isDSTShifted:function(){if(this._a){return this.isValid()&&compareArrays(this._a,(this._isUTC?moment.utc(this._a):moment(this._a)).toArray())>0}return false},parsingFlags:function(){return extend({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(keepLocalTime){return this.utcOffset(0,keepLocalTime)},local:function(keepLocalTime){if(this._isUTC){this.utcOffset(0,keepLocalTime);this._isUTC=false;if(keepLocalTime){this.subtract(this._dateUtcOffset(),"m")}}return this},format:function(inputString){var output=formatMoment(this,inputSLine truncated
{{ relativeTime }}
</template><script>(function(){var UPDATE_INTERVAL=6e4;var parseDateTime=window.hass.util.parseDateTime;Polymer("relative-ha-datetime",{relativeTime:"",parsedDateTime:null,created:function(){this.updateRelative=this.updateRelative.bind(this)},attached:function(){this._interval=setInterval(this.updateRelative,UPDATE_INTERVAL)},detached:function(){clearInterval(this._interval)},datetimeChanged:function(oldVal,newVal){this.parsedDateTime=newVal?parseDateTime(newVal):null;this.updateRelative()},updateRelative:function(){this.relativeTime=this.parsedDateTime?moment(this.parsedDateTime).fromNow():""}})})();</script></polymer-element><polymer-element name="state-info" attributes="stateObj" assetpath="polymer/components/"><template><style>state-badge{float:left}.name{text-transform:capitalize;font-weight:300;font-size:1.3rem}.info{margin-left:60px}.time-ago{color:darkgrey;margin-top:-2px}</style><div><state-badge stateobj="{{stateObj}}"></state-badge><div class="info"><div class="name">
{{stateObj.entityDisplay}}
</div><div class="time-ago"><core-tooltip label="{{stateObj.lastChanged}}" position="bottom"><relative-ha-datetime datetime="{{stateObj.lastChanged}}"></relative-ha-datetime></core-tooltip></div></div></div></template><script>Polymer("state-info");</script></polymer-element><polymer-element name="state-card-display" attributes="stateObj" assetpath="polymer/cards/"><template><style>.state{margin-left:16px;text-transform:capitalize;font-weight:300;font-size:1.3rem;text-align:right}</style><div horizontal="" justified="" layout=""><state-info stateobj="{{stateObj}}"></state-info><div class="state">{{stateObj.stateDisplay}}</div></div></template><script>Polymer("state-card-display");</script></polymer-element><polymer-element name="paper-toggle-button" attributes="checked disabled" role="button" aria-pressed="false" tabindex="0" assetpath="polymer/bower_components/paper-toggle-button/"><template><style>:host{display:inline-block}:host(:focus){outline:0}.toggle-bar{background-color:#000}.toggle-button{background-color:#f1f1f1}[checked] .toggle{background-color:#0f9d58}.toggle-ink{color:#bbb}[checked] .toggle-ink{color:#0f9d58}#toggleContainer{position:relative;width:36px;height:14px}#toggleContainer[disabled]{opacity:.3;pointer-events:none}#toggleBar{position:absolute;height:100%;width:100%;border-radius:8px;pointer-events:none;opacity:.26;transition:background-color linear .08s}[checked] #toggleBar{opacity:.5}#toggleButton{position:absolute;top:-3px;height:20px;width:20px;border-radius:50%;box-shadow:0 1px 5px 0 rgba(0,0,0,.4);transition:-webkit-transform linear .08s,background-color linear .08s;transition:transform linear .08s,background-color linear .08s}#toggleButton.dragging{-webkit-transition:none;transition:none}[checked] #toggleButton{-webkit-transform:translate(16px,0);transform:translate(16px,0)}#ink{position:absolute;top:-14px;left:-14px;width:48px;height:48px;pointer-events:none}</style><core-a11y-keys target="{{}}" keys="space" on-keys-pressed="{{tap}}"></core-a11y-keys><div id="toggleContainer" checked?="{{checked}}" disabled?="{{disabled}}"><div id="toggleBar" class="toggle toggle-bar"></div><div id="toggleButton" class="toggle toggle-button"><paper-ripple id="ink" class="toggle-ink circle"></paper-ripple></div></div></template><script>Polymer("paper-toggle-button",{checked:false,disabled:false,eventDelegates:{down:"downAction",up:"upAction",tap:"tap",trackstart:"trackStart",trackx:"trackx",trackend:"trackEnd"},downAction:function(e){var rect=this.$.ink.getBoundingClientRect();this.$.ink.downAction({x:rect.left+rect.width/2,y:rect.top+rect.height/2})},upAction:function(e){this.$.ink.upAction()},tap:function(){if(this.disabled){return}this.checked=!this.checked;this.fire("change")},trackStart:function(e){if(this.disabled){return}this._w=this.$.toggleBar.offsetWidth/2;e.preventTap()},trackx:function(e){this._x=Math.min(this._w,Math.max(0,this.checked?this._w+e.dx:e.dx));this.$.toggleButton.classList.add("dragging");var s=this.$.toggleButton.style;s.webkitTransform=s.transform="translate3d("+this._x+"px,0,0)"},trackEnd:function(){var s=this.$.toggleButton.style;s.transform=s.webkitTransform="";this.$.toggleButton.classList.remove("dragging");var old=this.checked;this.checked=Math.abs(this._x)>this._w/2;if(this.checked!==old){this.fire("change")}},checkedChanged:function(){this.setAttribute("aria-pressed",Boolean(this.checked));this.fire("core-change")}});</script></polymer-element><polymer-element name="state-card-toggle" attributes="stateObj" assetpath="polymer/cards/"><template><core-style ref="ha-paper-toggle"></core-style><div horizontal="" justified="" layout=""><state-info flex="" stateobj="{{stateObj}}"></state-info><paper-toggle-button self-center="" checked="{{toggleChecked}}" on-change="{{toggleChanged}}" on-click="{{toggleClicked}}"></paper-toggle-button></div></template><script>var serviceActions=window.hass.serviceActions;Polymer("state-card-toggle",{toggleChecked:false,observe:{"stateObj.state":"stateChanged"},ready:function(){this.forceStateChange=this.forceStateChange.bind(this)},toggleClicked:function(ev){ev.stopPropagation()},toggleChanged:function(ev){var newVal=ev.target.checked;if(newVal&&this.stateObj.state==="off"){this.turn_on()}else if(!newVal&&this.stateObj.state==="on"){this.turn_off()}},stateObjChanged:function(oldVal,newVal){if(newVal){this.stateChanged(null,newVal.state)}},stateChanged:function(oldVal,newVal){this.toggleChecked=newVal==="on"},forceStateChange:function(){this.stateChanged(null,this.stateObj.state)},turn_on:function(){serviceActions.callTurnOn(this.stateObj.entityId).then(this.forceStateChange)},turn_off:function(){serviceActions.callTurnOff(this.stateObj.entityId).then(this.forceStateChange)}});</script></polymer-element><polymer-element name="state-card-thermostat" attributes="stateObj api" assetpath="polymer/cards/"><template><style>.state{margin-left:16px;text-align:right}.target{text-transform:capitalize;font-weight:300;font-size:1.3rem}.currLine truncated
{{stateObj.stateDisplay}}
</div><div class="current">
Currently: {{stateObj.attributes.current_temperature}} {{stateObj.attributes.unit_of_measurement}}
</div></div></div></template><script>Polymer("state-card-thermostat",{});</script></polymer-element><polymer-element name="state-card-configurator" attributes="stateObj" assetpath="polymer/cards/"><template><state-card-display stateobj="{{stateObj}}"></state-card-display><template if="{{stateObj.attributes.description_image}}"><img hidden src="{{stateObj.attributes.description_image}}"></template></template><script>Polymer("state-card-configurator");</script></polymer-element><polymer-element name="state-card-scene" attributes="stateObj" assetpath="polymer/cards/"><template><template if="{{allowToggle}}"><state-card-toggle stateobj="{{stateObj}}"></state-card-toggle></template><template if="{{!allowToggle}}"><state-card-display stateobj="{{stateObj}}"></state-card-display></template></template><script>(function(){Polymer("state-card-scene",{allowToggle:false,stateObjChanged:function(oldVal,newVal){this.allowToggle=newVal.state==="off"||newVal.attributes.active_requested}})})();</script></polymer-element><polymer-element name="state-card-content" attributes="stateObj" assetpath="polymer/cards/"><template><style>:host{display:block}</style><div id="cardContainer"></div></template><script>Polymer("state-card-content",{stateObjChanged:function(oldVal,newVal){var cardContainer=this.$.cardContainer;if(!newVal){if(cardContainer.lastChild){cardContainer.removeChild(cardContainer.lastChild)}return}if(!oldVal||oldVal.cardType!=newVal.cardType){if(cardContainer.lastChild){cardContainer.removeChild(cardContainer.lastChild)}var stateCard=document.createElement("state-card-"+newVal.cardType);stateCard.stateObj=newVal;cardContainer.appendChild(stateCard)}else{cardContainer.lastChild.stateObj=newVal}}});</script></polymer-element><polymer-element name="state-card" attributes="stateObj" on-click="cardClicked" assetpath="polymer/cards/"><template><style>:host{border-radius:2px;box-shadow:rgba(0,0,0,.098) 0 2px 4px,rgba(0,0,0,.098) 0 0 3px;transition:all .3s ease-out;position:relative;background-color:#fff;padding:16px;width:100%;cursor:pointer}</style><state-card-content stateobj="{{stateObj}}"></state-card-content></template><script>var uiActions=window.hass.uiActions;Polymer("state-card",{cardClicked:function(){uiActions.showMoreInfoDialog(this.stateObj.entityId)}});</script></polymer-element><polymer-element name="state-cards" attributes="states" assetpath="polymer/components/"><template><style>:host{display:block;width:100%}@media all and (min-width:1020px){.state-card{width:calc(50% - 44px);margin:8px 0 0 8px}}@media all and (min-width:1356px){.state-card{width:calc(33% - 38px)}}@media all and (min-width:1706px){.state-card{width:calc(25% - 42px)}}.no-states-content{max-width:500px;background-color:#fff;border-radius:2px;box-shadow:rgba(0,0,0,.098) 0 2px 4px,rgba(0,0,0,.098) 0 0 3px;padding:16px;margin:16px auto}</style><div horizontal="" layout="" wrap=""><template repeat="{{states as state}}"><state-card class="state-card" stateobj="{{state}}"></state-card></template><template if="{{states.length == 0}}"><div class="no-states-content"><content></content></div></template></div></template><script>Polymer("state-cards");</script></polymer-element><polymer-element name="partial-states" attributes="narrow togglePanel filter" assetpath="polymer/layouts/"><template><core-style ref="ha-animations"></core-style><style>.listening{position:absolute;top:0;left:0;right:0;z-index:1;border-radius:2px;box-shadow:rgba(0,0,0,.098) 0 2px 4px,rgba(0,0,0,.098) 0 0 3px;padding:16px;background-color:rgba(255,255,255,.95);line-height:2em;cursor:pointer}.interimTranscript{color:darkgrey}.listening paper-spinner{float:right}</style><partial-base narrow="{{narrow}}" togglepanel="{{togglePanel}}"><span header-title="">{{headerTitle}}</span><span header-buttons=""><paper-icon-button icon="refresh" class="{{isFetching && 'ha-spin'}}" on-click="{{handleRefreshClick}}" hidden?="{{isStreaming}}"></paper-icon-button><paper-icon-button icon="{{isListening ? 'av:mic-off' : 'av:mic' }}" hidden?="{{!canListen}}" on-click="{{handleListenClick}}"></paper-icon-button></span><div class="listening" hidden?="{{!isListening && !isTransmitting}}" on-click="{{handleListenClick}}"><core-icon icon="av:hearing"></core-icon> {{finalTranscript}}
<span class="interimTranscript">{{interimTranscript}}</span><paper-spinner active?="{{isTransmitting}}"></paper-spinner></div><state-cards states="{{states}}"><h3>Hi there!</h3><p>
It looks like we have nothing to show you right now. It could be that we have not yet discovered all your devices but it is more likely that you have not configured Home Assistant yet.
</p><p>
Please see the <a href="https://home-assistant.io/getting-started/" target="_blank">Getting Started</a> section on how to setup your devices.
</p></state-cards></partial-base></template><script>(function(){var storeListenerMixIn=window.hass.storeListenerMixIn;var syncActions=window.hass.syncActions;var voiceActions=window.hass.voiceActions;var stateStore=window.hass.stateStore;var uiConstants=window.hass.uiConstants;Polymer(Polymer.mixin({headerTitle:"States",states:[],isFetching:false,isStreaming:false,canListen:false,voiceSupported:false,hasConversationComponent:false,isListening:false,isTransmittingVoice:false,interimTranscript:"",finalTranscript:"",ready:function(){this.voiceSupported=voiceActions.isSupported()},attached:function(){this.listenToStores(true)},detached:function(){this.stopListeningToStores()},componentStoreChanged:function(componentStore){this.canListen=this.voiceSupported&&componentStore.isLoaded("conversation")},stateStoreChanged:function(){this.refreshStates()},syncStoreChanged:function(syncStore){this.isFetching=syncStore.isFetching},streamStoreChanged:function(streamStore){this.isStreaming=streamStore.isStreaming},voiceStoreChanged:function(voiceStore){this.isListening=voiceStore.isListening;this.isTransmitting=voiceStore.isTransmitting;this.finalTranscript=voiceStore.finalTranscript;this.interimTranscript=voiceStore.interimTranscript.slice(this.finalTranscript.length)},filterChanged:function(){this.refreshStates();this.headerTitle=uiConstants.STATE_FILTERS[this.filter]||"States"},refreshStates:function(){var states;if(this.filter){var filter=this.filter;states=stateStore.all.filter(function(state){return state.domain===filter})}else{states=stateStore.all.filter(function(state){return!(state.domain in uiConstants.STATE_FILTERS)})}this.states=states.toArray()},handleRefreshClick:function(){syncActions.fetchAll()},handleListenClick:function(){if(this.isListening){voiceActions.stop()}else{voiceActions.listen()}}},storeListenerMixIn))})();</script></polymer-element><polymer-element name="core-shared-lib" attributes="url notifyEvent callbackName" assetpath="polymer/bower_components/core-shared-lib/"><script>(function(){Polymer("core-shared-lib",{notifyEvent:"core-shared-lib-load",ready:function(){if(!this.url&&this.defaultUrl){this.url=this.defaultUrl}},urlChanged:function(){require(this.url,this,this.callbackName)},provide:function(){this.async("notify")},notify:function(){this.fire(this.notifyEvent,arguments)}});var apiMap={};function require(url,notifiee,callbackName){var name=nameFromUrl(url);var loader=apiMap[name];if(!loader){loader=apiMap[name]=new Loader(name,url,callbackName)}loader.requestNotify(notifiee)}function nameFromUrl(url){return url.replace(/[\:\/\%\?\&\.\=\-\,]/g,"_")+"_api"}var Loader=function(name,url,callbackName){this.instances=[];this.callbackName=callbackName;if(this.callbackName){window[this.callbackName]=this.success.bind(this)}else{if(url.indexOf(this.callbackMacro)>=0){this.callbackName=name+"_loaded";window[this.callbackName]=this.success.bind(this);url=url.replace(this.callbackMacro,this.callbackName)}else{throw"core-shared-api: a %%callback%% parameter is required in the API url"}}this.addScript(url)};Loader.prototype={callbackMacro:"%%callback%%",loaded:false,addScript:function(src){var script=document.createElement("script");script.src=src;script.onerror=this.error.bind(this);var s=document.querySelector("script");s.parentNode.insertBefore(script,s);this.script=script},removeScript:function(){if(this.script.parentNode){this.script.parentNode.removeChild(this.script)}this.script=null},error:function(){this.cleanup()},success:function(){this.loaded=true;this.cleanup();this.result=Array.prototype.slice.call(arguments);this.instances.forEach(this.provide,this);this.instances=null},cleanup:function(){delete window[this.callbackName]},provide:function(instance){instance.notify(instance,this.result)},requestNotify:function(instance){if(this.loaded){this.provide(instance)}else{this.instances.push(instance)}}}})();</script></polymer-element><polymer-element name="google-jsapi" extends="core-shared-lib" assetpath="polymer/bower_components/google-apis/"><script>Polymer("google-jsapi",{defaultUrl:"https://www.google.com/jsapi?callback=%%callback%%",notifyEvent:"api-load",get api(){return google}});</script></polymer-element><polymer-element name="state-timeline" attributes="stateHistory" assetpath="polymer/components/"><template><style>:host{display:block}</style><google-jsapi on-api-load="{{googleApiLoaded}}"></google-jsapi><div id="timeline" style="width: 100%; height: auto;"></div></template><script>Polymer("state-timeline",{apiLoaded:false,stateHistory:null,googleApiLoaded:function(){google.load("visualization","1",{packages:["timeline"],callback:function(){this.apiLoaded=true;this.drawChart()}.bind(this)})},stateHistoryChanged:function(){this.drawChart()},drawChart:function(){if(!this.apiLoaded||!this.stateHistory){return}var container=this.$.timeline;var chart=new google.visualization.Timeline(container);var dataTable=new google.visualization.DataTable;dataTable.addColumn({type:"string",id:"ELine truncated
{{ time }}
</template><script>(function(){var timeFormatOptions={hour:"numeric",minute:"2-digit"};Polymer("display-time",{time:"",dateObjChanged:function(oldVal,newVal){if(!newVal){this.time=""}this.time=newVal.toLocaleTimeString([],timeFormatOptions)}})})();</script></polymer-element><polymer-element name="logbook-entry" attributes="entryObj" assetpath="polymer/components/"><template><core-style ref="ha-main"></core-style><style>.logbook-entry{line-height:2em}.time{width:55px;font-size:.8em}.icon{margin:0 8px 0 16px}.name{text-transform:capitalize}</style><div horizontal="" layout="" class="logbook-entry"><display-time dateobj="{{entryObj.when}}" class="time secondary-text-color"></display-time><domain-icon domain="{{entryObj.domain}}" class="icon primary-text-color"></domain-icon><div class="message primary-text-color" flex=""><template if="{{!entryObj.entityId}}"><span class="name">{{entryObj.name}}</span></template><template if="{{entryObj.entityId}}"><a href="polymer/components/#" on-click="{{entityClicked}}" class="name">{{entryObj.name}}</a></template>
{{entryObj.message}}
</div></div></template><script>(function(){var uiActions=window.hass.uiActions;Polymer("logbook-entry",{entityClicked:function(ev){ev.preventDefault();uiActions.showMoreInfoDialog(this.entryObj.entityId)}})})();</script></polymer-element><polymer-element name="ha-logbook" attributes="entries" assetpath="polymer/components/"><template><style></style><div class="logbook"><template repeat="{{entries as entry}}"><logbook-entry entryobj="{{entry}}"></logbook-entry></template></div></template><script>Polymer("ha-logbook");</script></polymer-element><polymer-element name="partial-logbook" attributes="narrow togglePanel" assetpath="polymer/layouts/"><template><style>.content{background-color:#fff;padding:8px}</style><partial-base narrow="{{narrow}}" togglepanel="{{togglePanel}}"><span header-title="">Logbook</span><span header-buttons=""><paper-icon-button icon="refresh" on-click="{{handleRefreshClick}}"></paper-icon-button></span><div flex="" class="{{ {content: true, narrow: narrow, wide: !narrow} | tokenList }}"><ha-logbook entries="{{entries}}"></ha-logbook></div></partial-base></template><script>var storeListenerMixIn=window.hass.storeListenerMixIn;var logbookActions=window.hass.logbookActions;Polymer(Polymer.mixin({entries:null,attached:function(){this.listenToStores(true)},detached:function(){this.stopListeningToStores()},logbookStoreChanged:function(logbookStore){if(logbookStore.isStale()){logbookActions.fetch()}this.entries=logbookStore.all.toArray()},handleRefreshClick:function(){logbookActions.fetch()}},storeListenerMixIn));</script></polymer-element><polymer-element name="paper-input" assetpath="polymer/bower_components/paper-input/"><template><style>:host{display:inline-block}</style><paper-input-decorator id="decorator" label="{{label}}" floatinglabel="{{floatingLabel}}" value="{{value}}" disabled?="{{disabled}}"><input is="core-input" id="input" value="{{value}}" committedvalue="{{committedValue}}" on-change="{{changeAction}}" disabled?="{{disabled}}"></paper-input-decorator></template><script>Polymer("paper-input",{publish:{label:"",floatingLabel:false,disabled:{value:false,reflect:true},value:"",committedValue:""},focus:function(){this.$.input.focus()},valueChanged:function(){this.$.decorator.updateLabelVisibility(this.value)},changeAction:function(e){this.fire("change",null,this)}});</script></polymer-element><polymer-element name="paper-autogrow-textarea" on-input="{{inputAction}}" assetpath="polymer/bower_components/paper-input/"><template><style>:host{display:inline-block;position:relative;width:400px}.mirror-text{visibility:hidden;word-wrap:break-word}::content textarea{padding:0;margin:0;border:none;outline:0;resize:none;width:100%;height:100%}::content textarea:invalid{box-shadow:none}</style><div id="mirror" class="mirror-text" aria-hidden="true">&nbsp;</div><div class="textarea-container" fit=""><content></content></div></template><script>Polymer("paper-autogrow-textarea",{publish:{target:null,rows:1,maxRows:0},tokens:null,observe:{rows:"updateCached",maxRows:"updateCached"},constrain:function(tokens){var _tokens;tokens=tokens||[""];if(this.maxRows>0&&tokens.length>this.maxRows){_tokens=tokens.slice(0,this.maxRows)}else{_tokens=tokens.slice(0)}while(this.rows>0&&_tokens.length<this.rows){_tokens.push("")}return _tokens.join("<br>")+"&nbsp;"},valueForMirror:function(input){this.tokens=input&&input.value?input.value.replace(/&/gm,"&amp;").replace(/"/gm,"&quot;").replace(/'/gm,"&#39;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").split("\n"):[""];return this.constrain(this.tokens)},update:function(input){this.$.mirror.innerHTML=this.valueForMirror(input)},updateCached:function(){this.$.mirror.innerHTML=this.constrain(this.tokens)},inputAction:function(e){this.update(e.target)}});</script></polymer-element><polymer-element name="events-list" attributes="cbEventClicked" assetpath="polymer/components/"><template><style>:host{display:block}.eventContainer{font-size:1rem}</style><template if="{{cbEventClicked}}"><style>a{text-decoration:underline;cursor:pointer}</style></template><div><template repeat="{{event in events}}"><div class="eventContainer"><a on-click="{{handleClick}}">{{event.event}}</a>
({{event.listener_count}} listeners)
</div></template></div></template><script>var storeListenerMixIn=window.hass.storeListenerMixIn;Polymer(Polymer.mixin({cbEventClicked:null,events:[],attached:function(){this.listenToStores(true)},detached:function(){this.stopListeningToStores()},eventStoreChanged:function(eventStore){this.events=eventStore.all.toArray()},handleClick:function(ev){if(this.cbEventClicked){this.cbEventClicked(ev.path[0].innerHTML)}}},storeListenerMixIn));</script></polymer-element><polymer-element name="partial-dev-fire-event" attributes="narrow togglePanel" assetpath="polymer/layouts/"><template><style>.form{padding:24px;background-color:#fff}</style><partial-base narrow="{{narrow}}" togglepanel="{{togglePanel}}"><span header-title="">Fire Event</span><div class="form" fit=""><p>
Fire an event on the event bus.
</p><div layout="" horizontal?="{{!narrow}}" vertical?="{{narrow}}"><div class="ha-form" flex?="{{!narrow}}"><paper-input id="inputType" label="Event Type" floatinglabel="true" autofocus required></paper-input><paper-input-decorator label="Event Data (JSON, optional)" floatinglabel="true"><paper-autogrow-textarea id="inputDataWrapper"><textarea id="inputData"></textarea></paper-autogrow-textarea></paper-input-decorator><paper-button on-click="{{clickFireEvent}}">Fire Event</paper-button></div><div class="sidebar"><b>Available events:</b><events-list cbeventclicked="{{eventSelected}}"></events-list></div></div></div></partial-base></template><script>var eventActions=window.hass.eventActions;Polymer("partial-dev-fire-event",{ready:function(){this.eventSelected=this.eventSelected.bind(this)},eventSelected:function(eventType){this.$.inputType.value=eventType},clickFireEvent:function(){try{eventActions.fire(this.$.inputType.value,this.$.inputData.value?JSON.parse(this.$.inputData.value):{})}catch(err){alert("Error parsing JSON: "+err)}}});</script></polymer-element><polymer-element name="core-item" attributes="label icon src" horizontal="" center="" layout="" assetpath="polymer/bower_components/core-item/"><template><style>:host{display:block;position:relative;min-height:40px;white-space:nowrap}:host(.font-scalable){min-height:2.5em}:host(.core-selected){font-weight:700}#icon{margin:0 16px 0 4px}:host(.font-scalable) #icon{margin:0 1em 0 .25em;height:1.5em;width:1.5em}polyfill-next-selector{content:':host > a'}::content>a{position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.000001)}</style><template if="{{icon || src}}"><core-icon src="{{src}}" id="icon" icon="{{icon}}" hidden?="{{!src && !icon}}"></core-icon></template><div id="label">{{label}}</div><content></content></template><script>Polymer("core-item",{});</script></polymer-element><style shim-shadowdom="">html /deep/ core-collapse{display:block}html /deep/ .core-collapse-closed{display:none}</style><polymer-element name="core-collapse" attributes="target horizontal opened duration fixedSize allowOverflow" assetpath="polymer/bower_components/core-collapse/"><template><content></content></template><script>Polymer("core-collapse",{target:null,horizontal:false,opened:false,duration:.33,fixedSize:false,allowOverflow:false,created:function(){this.transitionEndListener=this.transitionEnd.bind(this)},ready:function(){this.target=this.target||this},domReady:function(){this.async(function(){this.afterInitialUpdate=true})},detached:function(){if(this.target){this.removeListeners(this.target)}},targetChanged:function(old){if(old){this.removeListeners(old)}if(!this.target){return}this.isTargetReady=!!this.target;this.classList.toggle("core-collapse-closed",this.target!==this);this.toggleOpenedStyle(false);this.horizontalChanged();this.addListeners(this.target);this.toggleClosedClass(true);this.update()},addListeners:function(node){node.addEventListener("transitionend",this.transitionEndListener)},removeListeners:function(node){node.removeEventListener("transitionend",this.transitionEndListener)},horizontalChanged:function(){this.dimension=this.horizontal?"width":"height"},openedChanged:function(){this.update();this.fire("core-collapse-open",this.opened)},toggle:function(){this.opened=!this.opened},setTransitionDuration:function(duration){var s=this.target.style;s.transition=duration?this.dimension+" "+duration+"s":null;if(duration===0){this.async("transitionEnd")}},transitionEnd:function(){if(this.opened&&!this.fixedSize){this.updateSize("auto",null)}this.setTransitionDuration(null);this.toggleOpenedStyle(this.opened);this.toggleClosedClass(!this.opened);this.asyncFire("core-resize",null,this.target)},toggleClosedClass:function(closed){this.hasClosedClass=closed;this.target.classList.toggle("core-collapse-closed",closed)},toggleOpenedStyle:function(opened){this.target.style.overflow=this.allowOverflow&&opened?"":"hidden"},updateSize:function(size,duration,forceEnd){this.setTransitionDuration(duration);this.calcSize();var s=this.target.style;var nochange=s[this.dimension]===size;s[this.dimension]=size;if(forceEnd&&nochange){this.transitionEnd()}},update:function(){if(!this.target){return}if(!this.isTargetReady){this.targetChanged()}this.horizontalChanged();this[this.opened?"show":"hide"]()},calcSize:function(){return this.target.getBoundingClientRect()[this.dimension]+"px"},getComputedSize:function(){return getComputedStyle(this.target)[this.dimension]},show:function(){this.toggleClosedClass(false);if(!this.afterInitialUpdate){this.transitionEnd();return}if(!this.fixedSize){this.updateSize("auto",null);var s=this.calcSize();if(s=="0px"){this.transitionEnd();return}this.updateSize(0,null)}this.async(function(){this.updateSize(this.size||s,this.duration,true)})},hide:function(){this.toggleOpenedStyle(false);if(this.hasClosedClass&&!this.fixedSize){return}if(this.fixedSize){this.size=this.getComputedSize()}else{this.updateSize(this.calcSize(Line truncated
Call a service from a component.
</p><div layout="" horizontal?="{{!narrow}}" vertical?="{{narrow}}"><div class="ha-form" flex?="{{!narrow}}"><paper-input id="inputDomain" label="Domain" floatinglabel="true" autofocus required></paper-input><paper-input id="inputService" label="Service" floatinglabel="true" required></paper-input><paper-input-decorator label="Service Data (JSON, optional)" floatinglabel="true"><paper-autogrow-textarea id="inputDataWrapper"><textarea id="inputData"></textarea></paper-autogrow-textarea></paper-input-decorator><paper-button on-click="{{clickCallService}}">Call Service</paper-button></div><div class="sidebar"><b>Available services:</b><services-list cbserviceclicked="{{serviceSelected}}"></services-list></div></div></div></partial-base></template><script>var serviceActions=window.hass.serviceActions;Polymer("partial-dev-call-service",{ready:function(){this.serviceSelected=this.serviceSelected.bind(this)},setService:function(domain,service){this.$.inputDomain.value=domain;this.$.inputService.value=service},serviceSelected:function(domain,service){this.setService(domain,service)},clickCallService:function(){try{serviceActions.callService(this.$.inputDomain.value,this.$.inputService.value,this.$.inputData.value?JSON.parse(this.$.inputData.value):{})}catch(err){alert("Error parsing JSON: "+err)}}});</script></polymer-element><polymer-element name="entity-list" attributes="cbEntityClicked" assetpath="polymer/components/"><template><style>:host{display:block}.entityContainer{font-size:1rem}</style><template if="{{cbEntityClicked}}"><style>a{text-decoration:underline;cursor:pointer}</style></template><div><template repeat="{{entityID in entityIDs}}"><div class="eventContainer"><a on-click="{{handleClick}}">{{entityID}}</a></div></template></div></template><script>var storeListenerMixIn=window.hass.storeListenerMixIn;Polymer(Polymer.mixin({cbEventClicked:null,entityIDs:[],attached:function(){this.listenToStores(true)},detached:function(){this.stopListeningToStores()},stateStoreChanged:function(stateStore){this.entityIDs=stateStore.entityIDs.toArray()},handleClick:function(ev){if(this.cbEntityClicked){this.cbEntityClicked(ev.path[0].innerHTML)}}},storeListenerMixIn));</script></polymer-element><polymer-element name="partial-dev-set-state" attributes="narrow togglePanel" assetpath="polymer/layouts/"><template><style>.form{padding:24px;background-color:#fff}</style><partial-base narrow="{{narrow}}" togglepanel="{{togglePanel}}"><span header-title="">Set State</span><div class="form" fit=""><div>
Set the representation of a device within Home Assistant.<br>
This will not communicate with the actual device.
</div><div layout="" horizontal?="{{!narrow}}" vertical?="{{narrow}}"><div class="ha-form" flex?="{{!narrow}}"><paper-input id="inputEntityID" label="Entity ID" floatinglabel="true" autofocus required></paper-input><paper-input id="inputState" label="State" floatinglabel="true" required></paper-input><paper-input-decorator label="State attributes (JSON, optional)" floatinglabel="true"><paper-autogrow-textarea id="inputDataWrapper"><textarea id="inputData"></textarea></paper-autogrow-textarea></paper-input-decorator><paper-button on-click="{{clickSetState}}">Set State</paper-button></div><div class="sidebar"><b>Current entities:</b><entity-list cbentityclicked="{{entitySelected}}"></entity-list></div></div></div></partial-base></template><script>var stateStore=window.hass.stateStore;var stateActions=window.hass.stateActions;Polymer("partial-dev-set-state",{ready:function(){this.entitySelected=this.entitySelected.bind(this)},setEntityId:function(entityId){this.$.inputEntityID.value=entityId},setState:function(state){this.$.inputState.value=state},setStateData:function(stateData){var value=stateData?JSON.stringify(stateData,null," "):"";this.$.inputData.value=value;this.$.inputDataWrapper.update(this.$.inputData)},entitySelected:function(entityId){this.setEntityId(entityId);var state=stateStore.get(entityId);this.setState(state.state);this.setStateData(state.attributes)},clickSetState:function(ev){try{stateActions.set(this.$.inputEntityID.value,this.$.inputState.value,this.$.inputData.value?JSON.parse(this.$.inputData.value):{})}catch(err){alert("Error parsing JSON: "+err)}}});</script></polymer-element><polymer-element name="core-transition" extends="core-meta" assetpath="polymer/bower_components/core-transition/"><script>Polymer("core-transition",{type:"transition",go:function(node,state){this.complete(node)},setup:function(node){},teardown:function(node){},complete:function(node){this.fire("core-transitionend",null,node)},listenOnce:function(node,event,fn,args){var self=this;var listener=function(){fn.apply(self,args);node.removeEventListener(event,listener,false)};node.addEventListener(event,listener,false)}});</script></polymer-element><polymer-element name="core-key-helper" assetpath="polymer/bower_components/core-overlay/"><script>Polymer("core-key-helper",{ENTER_KEY:13,ESCAPE_KEY:27});</script></polymer-element><polymer-element name="core-overlay-layer" assetpath="polymer/bower_components/core-overlay/"><template><style>:host{position:fixed;top:0;left:0;z-index:1000;display:none}:host(.core-opened){display:block}</style><content></content></template><script>(function(){Polymer("core-overlay-layer",{publish:{opened:false},openedChanged:function(){this.classList.toggle("core-opened",this.opened)},addElement:function(element){if(!this.parentNode){document.querySelector("body").appendChild(this)}if(element.parentNode!==this){element.__contents=[];var ip$=element.querySelectorAll("content");for(var i=0,l=ip$.length,n;i<l&&(n=ip$[i]);i++){this.moveInsertedElements(n);this.cacheDomLocation(n);n.parentNode.removeChild(n);element.__contents.push(n)}this.cacheDomLocation(element);this.updateEventController(element);var h=this.makeHost();h.shadowRoot.appendChild(element);element.__host=h}},makeHost:function(){var h=document.createElement("overlay-host");h.createShadowRoot();this.appendChild(h);return h},moveInsertedElements:function(insertionPoint){var n$=insertionPoint.getDistributedNodes();var parent=insertionPoint.parentNode;insertionPoint.__contents=[];for(var i=0,l=n$.length,n;i<l&&(n=n$[i]);i++){this.cacheDomLocation(n);this.updateEventController(n);insertionPoint.__contents.push(n);parent.appendChild(n)}},updateEventController:function(element){element.eventController=this.element.findController(element)},removeElement:function(element){element.eventController=null;this.replaceElement(element);var h=element.__host;if(h){h.parentNode.removeChild(h)}},replaceElement:function(element){if(element.__contents){for(var i=0,c$=element.__contents,c;c=c$[i];i++){this.replaceElement(c)}element.__contents=null}if(element.__parentNode){var n=element.__nextElementSibling&&element.__nextElementSibling===element.__parentNode?element.__nextElementSibling:null;element.__parentNode.insertBefore(element,n)}},cacheDomLocation:function(element){element.__nextElementSibling=element.nextElementSibling;element.__parentNode=element.parentNode}})})();</script></polymer-element><style>.core-overlay-backdrop{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#000;opacity:0;transition:opacity .2s}.core-overlay-backdrop.core-opened{opacity:.6}</style><polymer-element name="core-overlay" assetpath="polymer/bower_components/core-overlay/"><script>(function(){Polymer(Polymer.mixin({publish:{target:null,sizingTarget:null,opened:false,backdrop:false,layered:false,autoCloseDisabled:false,autoFocusDisabled:false,closeAttribute:"core-overlay-toggle",closeSelector:"",transition:"core-transition-fade"},captureEventName:Line truncated
{{key}}
</div><div class="value">
{{stateObj.attributes[key]}}
</div></div></template></div></template><script>Polymer("more-info-default",{getKeys:function(obj){return Object.keys(obj||{})}});</script></polymer-element><polymer-element name="core-range" attributes="value min max step ratio" assetpath="polymer/bower_components/core-range/"><script>Polymer("core-range",{value:0,min:0,max:100,step:1,ratio:0,observe:{"value min max step":"update"},calcRatio:function(value){return(this.clampValue(value)-this.min)/(this.max-this.min)},clampValue:function(value){return Math.min(this.max,Math.max(this.min,this.calcStep(value)))},calcStep:function(value){return this.step?Math.round(value/this.step)/(1/this.step):value},validateValue:function(){var v=this.clampValue(this.value);this.value=this.oldValue=isNaN(v)?this.oldValue:v;return this.value!==v},update:function(){this.validateValue();this.ratio=this.calcRatio(this.value)*100}});</script></polymer-element><polymer-element name="paper-progress" extends="core-range" attributes="secondaryProgress indeterminate" assetpath="polymer/bower_components/paper-progress/"><template><style>:host{display:inline-block;width:200px;height:4px}#progressContainer{position:relative;height:100%;background-color:#c8c8c8;overflow:hidden}#activeProgress,#secondaryProgress{-webkit-transform-origin:left center;transform-origin:left center;-webkit-transform:scaleX(0);transform:scaleX(0)}#activeProgress{background-color:#0f9d58}#secondaryProgress{background-color:#87ceac}#activeProgress.indeterminate{-webkit-transform-origin:center center;transform-origin:center center;-webkit-animation:indeterminate-bar 1s linear infinite;animation:indeterminate-bar 1s linear infinite}@-webkit-keyframes indeterminate-bar{0%{-webkit-transform:translate(-50%) scaleX(0)}50%{-webkit-transform:translate(0%) scaleX(0.3)}100%{-webkit-transform:translate(50%) scaleX(0)}}@keyframes indeterminate-bar{0%{transform:translate(-50%) scaleX(0)}50%{transform:translate(0%) scaleX(0.3)}100%{transform:translate(50%) scaleX(0)}}</style><div id="progressContainer" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="{{min}}" aria-valuemax="{{max}}"><div id="secondaryProgress" fit=""></div><div id="activeProgress" fit=""></div></div></template><script>Polymer("paper-progress",{secondaryProgress:0,indeterminate:false,step:0,observe:{"value secondaryProgress min max indeterminate":"update"},update:function(){this.super();this.secondaryProgress=this.clampValue(this.secondaryProgress);this.secondaryRatio=this.calcRatio(this.secondaryProgress)*100;this.$.activeProgress.classList.toggle("indeterminate",this.indeterminate)},transformProgress:function(progress,ratio){var transform="scaleX("+ratio/100+")";progress.style.transform=progress.style.webkitTransform=transform},ratioChanged:function(){this.transformProgress(this.$.activeProgress,this.ratio)},secondaryRatioChanged:function(){this.transformProgress(this.$.secondaryProgress,this.secondaryRatio)}});</script></polymer-element><polymer-element name="paper-slider" extends="core-range" attributes="snaps pin disabled secondaryProgress editable immediateValue" role="slider" tabindex="0" aria-valuemin="0" aria-valuemax="100" assetpath="polymer/bower_components/paper-slider/"><template><style>:host{display:inline-block;width:200px;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}:host(:focus){outline:0}#sliderContainer{position:relative;width:calc(100% - 32px);height:32px}#sliderContainer.editable{float:left;width:calc(100% - 72px);margin:12px 0}.bar-container{position:absolute;top:0;left:16px;height:100%;width:100%;overflow:hidden}.ring>.bar-container{left:20px;width:calc(100% - 4px);transition:left .18s ease,width .18s ease}.ring.expand:not(.pin)>.bar-container{left:30px;width:calc(100% - 14px)}.ring.expand.dragging>.bar-container{transition:none}#sliderBar{position:absolute;top:15px;left:0;height:2px;width:100%;padding:8px 0;margin:-8px 0}.ring #sliderBar{left:-4px;width:calc(100% + 4px)}.ring.expand:not(.pin) #sliderBar{left:-14px;width:calc(100% + 14px)}.slider-markers{position:absolute;top:15px;left:15px;height:2px;width:calc(100% + 2px);box-sizing:border-box;pointer-events:none}.slider-markers::after,.slider-marker::after{content:"";display:block;width:2px;height:2px;border-radius:50%;background-color:#000}#sliderBar::shadow #activeProgress{background-color:#3f51b5}.transiting #sliderBar::shadow #activeProgress{transition:-webkit-transform .08s ease;transition:transform .08s ease}#sliderKnob{position:absolute;left:0;top:0;width:32px;height:32px}.transiting>#sliderKnob{transition:left .08s ease}#sliderKnob:focus{outline:0}#sliderKnob.dragging{transition:none}.snaps>#sliderKnob.dragging{transition:-webkit-transform .08s ease;transition:transform .08s ease}#sliderKnobInner{width:12px;height:12px;box-sizing:border-box;-moz-box-sizing:border-box;border-radius:50%;background-color:#3f51b5;transition:height .18s ease,width .18s ease}.expand:not(Line truncated
Rising <relative-ha-datetime datetime="{{stateObj.attributes.next_rising}}"></relative-ha-datetime></div><div class="value">
{{stateObj.attributes.next_rising | HATimeStripDate}}
</div></div><div layout="" justified="" horizontal="" class="data-entry" id="setting"><div class="key">
Setting <relative-ha-datetime datetime="{{stateObj.attributes.next_setting}}"></relative-ha-datetime></div><div class="value">
{{stateObj.attributes.next_setting | HATimeStripDate}}
</div></div></div></template><script>var parseDateTime=window.hass.util.parseDateTime;Polymer("more-info-sun",{stateObjChanged:function(){var rising=parseDateTime(this.stateObj.attributes.next_rising);var setting=parseDateTime(this.stateObj.attributes.next_setting);if(rising>setting){this.$.sunData.appendChild(this.$.rising)}else{this.$.sunData.appendChild(this.$.setting)}}});</script></polymer-element><polymer-element name="more-info-configurator" attributes="stateObj" assetpath="polymer/more-infos/"><template><style>p{margin:8px 0}p>img{max-width:100%}p.center{text-align:center}p.error{color:#C62828}p.submit{text-align:center;height:41px}p.submit paper-spinner{margin-right:16px}p.submit span{display:inline-block;vertical-align:top;margin-top:6px}</style><div layout="" vertical=""><template if="{{stateObj.state == 'configure'}}"><p hidden?="{{!stateObj.attributes.description}}">
{{stateObj.attributes.description}}
</p><p class="error" hidden?="{{!stateObj.attributes.errors}}">
{{stateObj.attributes.errors}}
</p><p class="center" hidden?="{{!stateObj.attributes.description_image}}"><img src="{{stateObj.attributes.description_image}}"></p><p class="submit"><paper-button raised="" on-click="{{submitClicked}}" hidden?="{{action !== 'display'}}">
{{stateObj.attributes.submit_caption || "Set configuration"}}
</paper-button><span hidden?="{{action !== 'configuring'}}"><paper-spinner active="true"></paper-spinner><span>Configuring…</span></span></p></template></div></template><script>var storeListenerMixIn=window.hass.storeListenerMixIn;var syncActions=window.hass.syncActions;var serviceActions=window.hass.serviceActions;Polymer(Polymer.mixin({action:"display",isStreaming:false,attached:function(){this.listenToStores(true)},detached:function(){this.stopListeningToStores()},streamStoreChanged:function(streamStore){this.isStreaming=streamStore.isStreaming},submitClicked:function(){this.action="configuring";var data={configure_id:this.stateObj.attributes.configure_id};serviceActions.callService("configurator","configure",data).then(function(){this.action="display";if(!this.isStreaming){syncActions.fetchAll()}}.bind(this),function(){this.action="display"}.bind(this))}},storeListenerMixIn));</script></polymer-element><polymer-element name="more-info-thermostat" attributes="stateObj" assetpath="polymer/more-infos/"><template><style>paper-slider{width:100%}paper-slider::shadow #sliderKnobInner,paper-slider::shadow #sliderBar::shadow #activeProgress{background-color:#039be5}.away-mode-toggle{display:none;margin-top:16px}:host-context(.has-away_mode) .away-mode-toggle{display:block}</style><div><div><div>Target Temperature</div><paper-slider min="{{tempMin}}" max="{{tempMax}}" value="{{targetTemperatureSliderValue}}" pin="" on-change="{{targetTemperatureSliderChanged}}"></paper-slider></div><div class="away-mode-toggle"><div center="" horizontal="" layout=""><div flex="">Away Mode</div><paper-toggle-button checked="{{awayToggleChecked}}" on-change="{{toggleChanged}}"></paper-toggle-button></div></div></div></template><script>var constants=window.hass.constants;Polymer("more-info-thermostat",{tempMin:10,tempMax:40,targetTemperatureSliderValue:0,awayToggleChecked:false,observe:{"stateObj.attributes.away_mode":"awayChanged"},stateObjChanged:function(oldVal,newVal){this.targetTemperatureSliderValue=this.stateObj.state;if(this.stateObj.attributes.unit_of_measurement===constants.UNIT_TEMP_F){this.tempMin=45;this.tempMax=95}else{this.tempMin=7;this.tempMax=35}},targetTemperatureSliderChanged:function(ev,details,target){var temp=parseInt(target.value);if(isNaN(temp))return;serviceActions.callService("thermostat","set_temperature",{entity_id:this.stateObj.entityId,temperature:temp})},toggleChanged:function(ev){var newVal=ev.target.checked;if(newVal&&this.stateObj.attributes.away_mode==="off"){this.service_set_away(true)}else if(!newVal&&this.stateObj.attributes.away_mode==="on"){this.service_set_away(false)}},awayChanged:function(oldVal,newVal){this.awayToggleChecked=newVal=="on"},service_set_away:function(away_mode){serviceActions.callService("thermostat","set_away_mode",{entity_id:this.stateObj.entityId,away_mode:away_mode}).then(function(){this.awayChanged(null,this.stateObj.attributes.away_mode)}.bind(this))}});</script></polymer-element><polymer-element name="more-info-script" attributes="stateObj" assetpath="polymer/more-infos/"><template><core-style ref="ha-key-value-table"></core-style><style>.data-entry .value{max-width:200px}</style><div layout="" vertical=""><div layout="" justified="" horizontal="" class="data-entry"><div class="key">Last Action</div><div class="value">
{{stateObj.attributes.last_action}}
</div></div></div></template><script>Polymer("more-info-script");</script></polymer-element><polymer-element name="more-info-content" attributes="stateObj dialogOpen" assetpath="polymer/more-infos/"><template><style>:host{display:block}</style><div id="moreInfoContainer" class="{{classNames}}"></div></template><script>Polymer("more-info-content",{classNames:"",dialogOpen:false,observe:{"stateObj.attributes":"stateAttributesChanged"},dialogOpenChanged:function(oldVal,newVal){var moreInfoContainer=this.$.moreInfoContainer;if(moreInfoContainer.lastChild){moreInfoContainer.lastChild.dialogOpen=newVal}},stateObjChanged:function(oldVal,newVal){var moreInfoContainer=this.$.moreInfoContainer;if(!newVal){if(moreInfoContainer.lastChild){moreInfoContainer.removeChild(moreInfoContainer.lastChild)}return}if(!oldVal||oldVal.moreInfoType!=newVal.moreInfoType){if(moreInfoContainer.lastChild){moreInfoContainer.removeChild(moreInfoContainer.lastChild)}var moreInfo=document.createElement("more-info-"+newVal.moreInfoType);moreInfo.stateObj=newVal;moreInfo.dialogOpen=this.dialogOpen;moreInfoContainer.appendChild(moreInfo)}else{moreInfoContainer.lastChild.dialogOpen=this.dialogOpen;moreInfoContainer.lastChild.stateObj=newVal}},stateAttributesChanged:function(oldVal,newVal){if(!newVal)return;this.classNames=Object.keys(newVal).map(function(key){return"has-"+key}).join(" ")}});</script></polymer-element><polymer-element name="more-info-dialog" assetpath="polymer/dialogs/"><template><ha-dialog id="dialog" on-core-overlay-open="{{dialogOpenChanged}}"><div><state-card-content stateobj="{{stateObj}}" style="margin-bottom: 24px;"></state-card-content><state-timeline statehistory="{{stateHistory}}"></state-timeline><more-info-content stateobj="{{stateObj}}" dialogopen="{{dialogOpen}}"></more-info-content></div></ha-dialog></template><script>var storeListenerMixIn=window.hass.storeListenerMixIn;var stateStore=window.hass.stateStore;var stateHistoryStore=window.hass.stateHistoryStore;var stateHistoryActions=window.hass.stateHistoryActions;Polymer(Polymer.mixin({entityId:false,stateObj:null,stateHistory:null,hasHistoryComponent:false,dialogOpen:false,observe:{"stateObj.attributes":"reposition"},created:function(){this.dialogOpenChanged=this.dialogOpenChanged.bind(this)},attached:function(){this.listenToStores(true)},detached:function(){this.stopListeningToStores()},componentStoreChanged:function(componentStore){this.hasHistoryComponent=componentStore.isLoaded("history")},stateStoreChanged:function(){var newState=this.entityId?stateStore.get(this.entityId):null;if(newState!==this.stateObj){this.stateObj=newState}},stateHistoryStoreChanged:function(){var newHistory;if(this.hasHistoryComponent&&this.entityId){newHistory=stateHistoryStore.get(this.entityId)}else{newHistory=null}if(newHistory!==this.stateHistory){this.stateHistory=newHistory}},dialogOpenChanged:function(ev){if(typeof ev==="object"){this.dialogOpen=ev.detail}},changeEntityId:function(entityId){this.entityId=entityId;this.stateStoreChanged();this.stateHistoryStoreChanged();if(this.hasHistoryComponent&&stateHistoryStore.isStale(entityId)){stateHistoryActions.fetch(entityId)}},reposition:function(oldVal,newVal){if(this.$.dialog.opened){this.job("resizeAfterLayoutChange",function(){this.$.dialog.resizeHandler()}.bind(this),1e3)}},show:function(entityId){this.changeEntityId(entityId);this.job("showDialogAfterRender",function(){this.$.dialog.toggle()}.bind(this))}},storeListenerMixIn));</script></polymer-element><polymer-element name="ha-modals" assetpath="polymer/components/"><template><more-info-dialog id="moreInfoDialog"></more-info-dialog></template><script>var uiActions=window.hass.uiActions,dispatcher=window.hass.dispatcher;Polymer("ha-modals",{ready:function(){dispatcher.register(function(payload){switch(payload.actionType){case uiActions.ACTION_SHOW_DIALOG_MORE_INFO:this.$.moreInfoDialog.show(payload.entityId);break}}.bind(this))}});</script></polymer-element><core-iconset-svg id="notification" iconsize="24"><svg><defs><g id="adb"><path d="M5 16c0 3.87 3.13 7 7 7s7-3.13 7-7v-4H5v4zM16.12 4.37l2.1-2.1-.82-.83-2.3 2.31C14.16 3.28 13.12 3 12 3s-2.16.28-3.09.75L6.6 1.44l-.82.83 2.1 2.1C6.14 5.64 5 7.68 5 10v1h14v-1c0-2.32-1.14-4.36-2.88-5.63zM9 9c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm6 0c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"/></g><g id="bluetooth-audio"><path d="M14.24 12.01l2.32 2.32c.28-.72.44-1.51.44-2.33 0-.82-.16-1.59-.43-2.31l-2.33 2.32zm5.29-5.3l-1.26 1.26c.63 1.21.98 2.57.98 4.02s-.36 2.82-.98 4.02l1.2 1.2c.97-1.54 1.54-3.36 1.54-5.31-.01-1.89-.55-3.67-1.48-5.19zm-3.82 1L10 2H9v7.59L4.41 5 3 6.41 8.59 12 3 17.59 4.41 19 9 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM11 5.83l1.88 1.88L11 9.59V5.83zm1.88 10.46L11 18.17v-3.76l1.88 1.88z"/></g><g id="disc-full"><path d="M20 16h2v-2h-2v2zm0-9v5h2V7h-2zM10 4c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm0 10c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"/></g><g id="dnd-forwardslash"><path d="M12 2C6.Line truncated
Home Assistant
</core-toolbar><core-menu id="menu" class="sidenav-menu" selected="0" excludedlocalnames="div" on-core-select="{{menuSelect}}" layout="" vertical=""><paper-item data-panel="states"><core-icon icon="apps"></core-icon>
States
</paper-item><template repeat="{{activeFilters as filter}}"><paper-item data-panel="states_{{filter}}"><core-icon icon="{{filter | filterIcon}}"></core-icon>
{{filter | filterName}}
</paper-item></template><template if="{{hasHistoryComponent}}"><paper-item data-panel="history"><core-icon icon="assessment"></core-icon>
History
</paper-item></template><template if="{{hasLogbookComponent}}"><paper-item data-panel="logbook"><core-icon icon="list"></core-icon>
Logbook
</paper-item></template><div flex=""></div><paper-item on-click="{{handleLogOutClick}}"><core-icon icon="exit-to-app"></core-icon>
Log Out
</paper-item><div class="text" horizontal="" layout="" center=""><div flex="">Streaming updates</div><stream-status></stream-status></div><div class="text label">Developer Tools</div><div class="dev-tools" layout="" horizontal="" justified=""><paper-icon-button icon="settings-remote" data-panel="call-service" on-click="{{handleDevClick}}"></paper-icon-button><paper-icon-button icon="settings-ethernet" data-panel="set-state" on-click="{{handleDevClick}}"></paper-icon-button><paper-icon-button icon="settings-input-antenna" data-panel="fire-event" on-click="{{handleDevClick}}"></paper-icon-button></div></core-menu></core-header-panel><partial-states hidden?="{{hideStates}}" main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}" filter="{{stateFilter}}"></partial-states><template if="{{selected == 'history'}}"><partial-history main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-history></template><template if="{{selected == 'logbook'}}"><partial-logbook main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-logbook></template><template if="{{selected == 'fire-event'}}"><partial-dev-fire-event main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-dev-fire-event></template><template if="{{selected == 'set-state'}}"><partial-dev-set-state main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-dev-set-state></template><template if="{{selected == 'call-service'}}"><partial-dev-call-service main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-dev-call-service></template></core-drawer-panel></template><script>(function(){var storeListenerMixIn=window.hass.storeListenerMixIn;var authActions=window.hass.authActions;var uiUtil=window.hass.uiUtil;var uiConstants=window.hass.uiConstants;Polymer(Polymer.mixin({selected:"states",stateFilter:null,narrow:false,activeFilters:[],hasHistoryComponent:false,hasLogbookComponent:false,isStreaming:false,hasStreamError:false,hideStates:false,attached:function(){this.togglePanel=this.togglePanel.bind(this);this.listenToStores(true)},detached:function(){this.stopListeningToStores()},stateStoreChanged:function(stateStore){this.activeFilters=stateStore.domains.filter(function(domain){return domain in uiConstants.STATE_FILTERS}).toArray()},componentStoreChanged:function(componentStore){this.hasHistoryComponent=componentStore.isLoaded("history");this.hasLogbookComponent=componentStore.isLoaded("logbook")},streamStoreChanged:function(streamStore){this.isStreaming=streamStore.isStreaming;this.hasStreamError=streamStore.hasError},menuSelect:function(ev,detail,sender){if(detail.isSelected){this.selectPanel(detail.item)}},handleDevClick:function(ev,detail,sender){this.$.menu.selected=-1;this.selectPanel(ev.target)},selectPanel:function(element){var newChoice=element.dataset.panel;if(newChoice!==this.selected){this.togglePanel();this.selected=newChoice}if(this.selected.substr(0,7)==="states_"){this.hideStates=false;this.stateFilter=this.selected.substr(7)}else{this.hideStates=this.selected!=="states";this.stateFilter=null}},responsiveChanged:function(ev,detail,sender){this.narrow=detail.narrow},togglePanel:function(){this.$.drawer.togglePanel()},handleLogOutClick:function(){authActions.logOut()},filterIcon:function(filter){return uiUtil.domainIcon(filter)},filterName:function(filter){return uiConstants.STATE_FILTERS[filter]}},storeListenerMixIn))})();</script></polymer-element></div>
<polymer-element name="home-assistant" attributes="auth" assetpath="polymer/"><template><style>:host{font-family:RobotoDraft,'Helvetica Neue',Helvetica,Arial;font-weight:300}</style><home-assistant-api auth="{{auth}}"></home-assistant-api><template if="{{!loaded}}"><login-form></login-form></template><template if="{{loaded}}"><home-assistant-main></home-assistant-main></template></template><script>var storeListenerMixIn=window.hass.storeListenerMixIn,uiActions=window.hass.uiActions,preferenceStore=window.hass.preferenceStore;Polymer(Polymer.mixin({loaded:false,ready:function(){document.getElementById("init").remove();if(this.auth){uiActions.validateAuth(this.auth,false)}else if(preferenceStore.hasAuthToken){uiActions.validateAuth(preferenceStore.authToken,false)}},attached:function(){this.listenToStores(true)},detached:function(){this.stopListeningToStores()},syncStoreChanged:function(syncStore){this.loaded=syncStore.initialLoadDone}},storeListenerMixIn));</script></polymer-element>
return pickBy("isBefore",args)};moment.max=function(){var args=[].slice.call(arguments,0);return pickBy("isAfter",args)};moment.utc=function(input,format,locale,strict){var c;if(typeof locale==="boolean"){strict=locale;locale=undefined}c={};c._isAMomentObject=true;c._useUTC=true;c._isUTC=true;c._l=locale;c._i=input;c._f=format;c._strict=strict;c._pf=defaultParsingFlags();return makeMoment(c).utc()};moment.unix=function(input){return moment(input*1e3)};moment.duration=function(input,key){var duration=input,match=null,sign,ret,parseIso,diffRes;if(moment.isDuration(input)){duration={ms:input._milliseconds,d:input._days,M:input._months}}else if(typeof input==="number"){duration={};if(key){duration[key]=input}else{duration.milliseconds=input}}else if(!!(match=aspNetTimeSpanJsonRegex.exec(input))){sign=match[1]==="-"?-1:1;duration={y:0,d:toInt(match[DATE])*sign,h:toInt(match[HOUR])*sign,m:toInt(match[MINUTE])*sign,s:toInt(match[SECOND])*sign,ms:toInt(match[MILLISECOND])*sign}}else if(!!(match=isoDurationRegex.exec(input))){sign=match[1]==="-"?-1:1;parseIso=function(inp){var res=inp&&parseFloat(inp.replace(",","."));return(isNaN(res)?0:res)*sign};duration={y:parseIso(match[2]),M:parseIso(match[3]),d:parseIso(match[4]),h:parseIso(match[5]),m:parseIso(match[6]),s:parseIso(match[7]),w:parseIso(match[8])}}else if(duration==null){duration={}}else if(typeof duration==="object"&&("from"in duration||"to"in duration)){diffRes=momentsDifference(moment(duration.from),moment(duration.to));duration={};duration.ms=diffRes.milliseconds;duration.M=diffRes.months}ret=new Duration(duration);if(moment.isDuration(input)&&hasOwnProp(input,"_locale")){ret._locale=input._locale}return ret};moment.version=VERSION;moment.defaultFormat=isoFormat;moment.ISO_8601=function(){};moment.momentProperties=momentProperties;moment.updateOffset=function(){};moment.relativeTimeThreshold=function(threshold,limit){if(relativeTimeThresholds[threshold]===undefined){return false}if(limit===undefined){return relativeTimeThresholds[threshold]}relativeTimeThresholds[threshold]=limit;return true};moment.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",function(key,value){return moment.locale(key,value)});moment.locale=function(key,values){var data;if(key){if(typeof values!=="undefined"){data=moment.defineLocale(key,values)}else{data=moment.localeData(key)}if(data){moment.duration._locale=moment._locale=data}}return moment._locale._abbr};moment.defineLocale=function(name,values){if(values!==null){values.abbr=name;if(!locales[name]){locales[name]=new Locale}locales[name].set(values);moment.locale(name);return locales[name]}else{delete locales[name];return null}};moment.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",function(key){return moment.localeData(key)});moment.localeData=function(key){var locale;if(key&&key._locale&&key._locale._abbr){key=key._locale._abbr}if(!key){return moment._locale}if(!isArray(key)){locale=loadLocale(key);if(locale){return locale}key=[key]}return chooseLocale(key)};moment.isMoment=function(obj){return obj instanceof Moment||obj!=null&&hasOwnProp(obj,"_isAMomentObject")};moment.isDuration=function(obj){return obj instanceof Duration};for(i=lists.length-1;i>=0;--i){makeList(lists[i])}moment.normalizeUnits=function(units){return normalizeUnits(units)};moment.invalid=function(flags){var m=moment.utc(NaN);if(flags!=null){extend(m._pf,flags)}else{m._pf.userInvalidated=true}return m};moment.parseZone=function(){return moment.apply(null,arguments).parseZone()};moment.parseTwoDigitYear=function(input){return toInt(input)+(toInt(input)>68?1900:2e3)};moment.isDate=isDate;extend(moment.fn=Moment.prototype,{clone:function(){return moment(this)},valueOf:function(){return+this._d-(this._offset||0)*6e4},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var m=moment(this).utc();if(0<m.year()&&m.year()<=9999){if("function"===typeof Date.prototype.toISOString){return this.toDate().toISOString()}else{return formatMoment(m,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}}else{return formatMoment(m,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}},toArray:function(){var m=this;return[m.year(),m.month(),m.date(),m.hours(),m.minutes(),m.seconds(),m.milliseconds()]},isValid:function(){return isValid(this)},isDSTShifted:function(){if(this._a){return this.isValid()&&compareArrays(this._a,(this._isUTC?moment.utc(this._a):moment(this._a)).toArray())>0}return false},parsingFlags:function(){return extend({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(keepLocalTime){return this.utcOffset(0,keepLocalTime)},local:function(keepLocalTime){if(this._isUTC){this.utcOffset(0,keepLocalTime);this._isUTC=false;if(keepLocalTime){this.subtract(this._dateUtcOffset(),"m")}}return this},format:function(inputString){var output=formatMoment(this,inputSLine truncated
@@ -2,26 +2,54 @@
<link rel="import" href="../bower_components/google-apis/google-jsapi.html">
<polymer-element name="state-timeline" attributes="stateHistory">
<polymer-element name="state-timeline" attributes="stateHistory isLoadingData">
<template>
<style>
:host {
display: block;
}
#loadingbox {
text-align: center;
}
.loadingmessage {
margin-top: 10px;
}
.singlelinechart {
min-height:140px;
}
</style>
<div style='width: 100%; height: auto;' hidden?="{{!isLoading}}" >
<div layout horizontal center id="splash">
<div layout vertical center flex>
<div id="loadingbox">
<paper-spinner active="true"></paper-spinner><br />
<div class="loadingmessage">{{spinnerMessage}}</div>
</div>
</div>
</div>
</div>
<google-jsapi on-api-load="{{googleApiLoaded}}"></google-jsapi>
<div id="timeline" style='width: 100%; height: auto;'></div>
<div id="timeline" style='width: 100%; height: auto;' class="{{ {singlelinechart: isSingleDevice && hasLineChart } | tokenList}}" hidden?="{{isLoadingData}}"></div>
<div id="line_graphs" style='width: 100%; height: auto;' hidden?="{{isLoadingData}}"></div>
</template>
<script>
Polymer({
apiLoaded: false,
stateHistory: null,
isLoading: true,
isLoadingData: false,
spinnerMessage: "Loading history data...",
isSingleDevice: false,
hasLineChart: false,
googleApiLoaded: function() {
google.load("visualization", "1", {
packages: ["timeline"],
packages: ["timeline", "corechart"],
callback: function() {
this.apiLoaded = true;
this.drawChart();
@@ -33,10 +61,17 @@
this.drawChart();
},
isLoadingDataChanged: function() {
if(this.isLoadingData) {
isLoading = true;
}
},
drawChart: function() {
if (!this.apiLoaded || !this.stateHistory) {
return;
}
this.isLoading = true;
var container = this.$.timeline;
var chart = new google.visualization.Timeline(container);
@@ -48,6 +83,7 @@
dataTable.addColumn({ type: 'date', id: 'End' });
var addRow = function(entityDisplay, stateStr, start, end) {
stateStr = stateStr.replace(/_/g, ' ');
dataTable.addRow([entityDisplay, stateStr, start, end]);
};
@@ -55,21 +91,39 @@
return;
}
// people can pass in history of 1 entityId or a collection.
this.hasLineChart = false;
this.isSingleDevice = false;
// people can pass in history of 1 entityId or a collection.
var stateHistory;
if (_.isArray(this.stateHistory[0])) {
stateHistory = this.stateHistory;
} else {
stateHistory = [this.stateHistory];
this.isSingleDevice = true;
}
var lineChartDevices = {};
var numTimelines = 0;
// stateHistory is a list of lists of sorted state objects
stateHistory.forEach(function(stateInfo) {
if(stateInfo.length === 0) return;
var entityDisplay = stateInfo[0].entityDisplay;
var newLastChanged, prevState = null, prevLastChanged = null;
//get the latest update to get the graph type from the component attributes
var attributes = stateInfo[stateInfo.length - 1].attributes;
//if the device has a unit of meaurment it will be added as a line graph further down
if(attributes.unit_of_measurement) {
if(!lineChartDevices[attributes.unit_of_measurement]){
lineChartDevices[attributes.unit_of_measurement] = [];
}
lineChartDevices[attributes.unit_of_measurement].push(stateInfo);
this.hasLineChart = true;
return;
}
stateInfo.forEach(function(state) {
if (prevState !== null && state.state !== prevState) {
@@ -86,10 +140,11 @@
});
addRow(entityDisplay, prevState, prevLastChanged, new Date());
numTimelines++;
}.bind(this));
chart.draw(dataTable, {
height: 55 + stateHistory.length * 42,
height: 55 + numTimelines * 42,
// interactive properties require CSS, the JS api puts it on the document
// instead of inside our Shadow DOM.
@@ -103,6 +158,162 @@
format: 'H:mm'
},
});
/**************************************************
The following code gererates line line graphs for devices with continuous
values(which are devices that have a unit_of_measurment values defined).
On each graph the devices are grouped by their unit of measurement, eg. all
sensors measuring MB will be a separate line on single graph. The google
chart API takes data as a 2 dimensional array in the format:
DateTime, device1, device2, device3
2015-04-01, 1, 2, 0
2015-04-01, 0, 1, 0
2015-04-01, 2, 1, 1
NOTE: the first column is a javascript date objects.
The first thing we do is build up the data with rows for each time of a state
change and initialise the values to 0. THen we loop through each device and
fill in its data.
**************************************************/
while (this.$.line_graphs.firstChild) {
this.$.line_graphs.removeChild(this.$.line_graphs.firstChild);
}
for (var key in lineChartDevices) {
var deviceStates = lineChartDevices[key];
if(this.isSingleDevice) {
container = this.$.timeline;
}
else {
container = document.createElement("DIV");
this.$.line_graphs.appendChild(container);
}
var chart = new google.visualization.LineChart(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'datetime', id: 'Time' });
var options = {
legend: { position: 'top' },
titlePosition: 'none',
vAxes: {
// Adds units to the left hand side of the graph
0: {title: key}
},
hAxis: {
format: 'H:mm'
},
lineWidth: 1,
chartArea:{left:'60',width:"95%"},
explorer: {
actions: ['dragToZoom', 'rightClickToReset', 'dragToPan'],
keepInBounds: true,
axis: 'horizontal',
maxZoomIn: 0.1
}
};
if(this.isSingleDevice) {
options.legend.position = 'none';
options.vAxes[0].title = null;
options.chartArea.left = 40;
options.chartArea.height = '80%';
options.chartArea.top = 5;
options.enableInteractivity = false;
}
// Get a unique list of times of state changes for all the device
// for a particular unit of measureent.
var times = _.pluck(_.flatten(deviceStates), "lastChangedAsDate");
times = _.uniq(times, function(e) {
return e.getTime();
});
times = _.sortBy(times, function(o) { return o; });
var data = [];
var empty = new Array(deviceStates.length);
for(var i = 0; i < empty.length; i++) {
empty[i] = 0;
}
var timeIndex = 1;
var endDate = new Date();
var prevDate = times[0];
for(var i = 0; i < times.length; i++) {
var currentDate = new Date(prevDate);
// because we only have state changes we add an extra point at the same time
// that holds the previous state which makes the line display correctly
var beforePoint = new Date(times[i]);
data.push([beforePoint].concat(empty));
data.push([times[i]].concat(empty));
prevDate = times[i];
timeIndex++;
}
data.push([endDate].concat(empty));
var deviceCount = 0;
deviceStates.forEach(function(device) {
var attributes = device[device.length - 1].attributes;
dataTable.addColumn('number', attributes.friendly_name);
var currentState = 0;
var previousState = 0;
var lastIndex = 0;
var count = 0;
var prevTime = data[0][0];
device.forEach(function(state) {
currentState = state.state;
var start = state.lastChangedAsDate;
if(state.state == 'None') {
currentState = previousState;
}
for(var i = lastIndex; i < data.length; i++) {
data[i][1 + deviceCount] = parseFloat(previousState);
// this is where data gets filled in for each time for the particular device
// because for each time two entires were create we fill the first one with the
// previous value and the second one with the new value
if(prevTime.getTime() == data[i][0].getTime() && data[i][0].getTime() == start.getTime()) {
data[i][1 + deviceCount] = parseFloat(currentState);
lastIndex = i;
prevTime = data[i][0];
break;
}
prevTime = data[i][0];
}
previousState = currentState;
count++;
}.bind(this));
//fill in the rest of the Array
for(var i = lastIndex; i < data.length; i++) {
data[i][1 + deviceCount] = parseFloat(previousState);
}
deviceCount++;
}.bind(this));
dataTable.addRows(data);
chart.draw(dataTable, options);
}
this.isLoading = (!this.isLoadingData) ? false : true;
},
});
@@ -11,7 +11,7 @@
<div>
<state-card-content stateObj="{{stateObj}}" style='margin-bottom: 24px;'>
</state-card-content>
<state-timeline stateHistory="{{stateHistory}}"></state-timeline>
<state-timeline stateHistory="{{stateHistory}}" isLoadingData="{{isLoadingHistoryData}}"></state-timeline>
<more-info-content
stateObj="{{stateObj}}"
dialogOpen="{{dialogOpen}}"></more-info-content>
@@ -30,6 +30,7 @@ Polymer(Polymer.mixin({
stateHistory: null,
hasHistoryComponent: false,
dialogOpen: false,
isLoadingHistoryData: false,
observe: {
'stateObj.attributes': 'reposition'
@@ -67,7 +68,7 @@ Polymer(Polymer.mixin({
} else {
newHistory = null;
}
this.isLoadingHistoryData = false;
if (newHistory !== this.stateHistory) {
this.stateHistory = newHistory;
}
@@ -87,6 +88,7 @@ Polymer(Polymer.mixin({
this.stateHistoryStoreChanged();
if (this.hasHistoryComponent && stateHistoryStore.isStale(entityId)) {
this.isLoadingHistoryData = true;
stateHistoryActions.fetch(entityId);
}
},
@@ -26,7 +26,7 @@
</span>
<div flex class="{{ {content: true, narrow: narrow, wide: !narrow} | tokenList }}">
<state-timeline stateHistory="{{stateHistory}}"></state-timeline>
<state-timeline stateHistory="{{stateHistory}}" isLoadingData="{{isLoadingData}}"></state-timeline>
</div>
</partial-base>
</template>
@@ -36,6 +36,7 @@
Polymer(Polymer.mixin({
stateHistory: null,
isLoadingData: false,
attached: function() {
this.listenToStores(true);
@@ -47,13 +48,18 @@
stateHistoryStoreChanged: function(stateHistoryStore) {
if (stateHistoryStore.isStale()) {
this.isLoadingData = true;
stateHistoryActions.fetchAll();
}
else {
this.isLoadingData = false;
}
this.stateHistory = stateHistoryStore.all;
},
handleRefreshClick: function() {
this.isLoadingData = true;
stateHistoryActions.fetchAll();
},
}, storeListenerMixIn));
@@ -143,8 +143,9 @@
return !(state.domain in uiConstants.STATE_FILTERS);
});
}
this.states = states.toArray();
this.states = states.toArray().filter(
function (el) {return !el.attributes.hidden});
},
handleRefreshClick: function() {
+54 -47
View File
@@ -7,9 +7,10 @@ Provides functionality to group devices that can be turned on or off.
import homeassistant as ha
from homeassistant.helpers import generate_entity_id
from homeassistant.helpers.entity import Entity
import homeassistant.util as util
from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME, STATE_ON, STATE_OFF,
ATTR_ENTITY_ID, STATE_ON, STATE_OFF,
STATE_HOME, STATE_NOT_HOME, STATE_UNKNOWN)
DOMAIN = "group"
@@ -110,35 +111,43 @@ def setup(hass, config):
return True
class Group(object):
class Group(Entity):
""" Tracks a group of entity ids. """
# pylint: disable=too-many-instance-attributes
def __init__(self, hass, name, entity_ids=None, user_defined=True):
self.hass = hass
self.name = name
self._name = name
self._state = STATE_UNKNOWN
self.user_defined = user_defined
self.entity_id = generate_entity_id(ENTITY_ID_FORMAT, name, hass=hass)
self.tracking = []
self.group_on, self.group_off = None, None
self.group_on = None
self.group_off = None
if entity_ids is not None:
self.update_tracked_entity_ids(entity_ids)
else:
self.force_update()
self.update_ha_state(True)
@property
def should_poll(self):
return False
@property
def name(self):
return self._name
@property
def state(self):
""" Return the current state from the group. """
return self.hass.states.get(self.entity_id)
return self._state
@property
def state_attr(self):
""" State attributes of this group. """
def state_attributes(self):
return {
ATTR_ENTITY_ID: self.tracking,
ATTR_AUTO: not self.user_defined,
ATTR_FRIENDLY_NAME: self.name
}
def update_tracked_entity_ids(self, entity_ids):
@@ -147,71 +156,69 @@ class Group(object):
self.tracking = tuple(ent_id.lower() for ent_id in entity_ids)
self.group_on, self.group_off = None, None
self.force_update()
self.update_ha_state(True)
self.start()
def force_update(self):
""" Query all the tracked states and update group state. """
for entity_id in self.tracking:
state = self.hass.states.get(entity_id)
if state is not None:
self._update_group_state(state.entity_id, None, state)
# If parsing the entitys did not result in a state, set UNKNOWN
if self.state is None:
self.hass.states.set(
self.entity_id, STATE_UNKNOWN, self.state_attr)
def start(self):
""" Starts the tracking. """
self.hass.states.track_change(self.tracking, self._update_group_state)
self.hass.states.track_change(
self.tracking, self._state_changed_listener)
def stop(self):
""" Unregisters the group from Home Assistant. """
self.hass.states.remove(self.entity_id)
self.hass.bus.remove_listener(
ha.EVENT_STATE_CHANGED, self._update_group_state)
ha.EVENT_STATE_CHANGED, self._state_changed_listener)
def _update_group_state(self, entity_id, old_state, new_state):
""" Updates the group state based on a state change by
a tracked entity. """
def update(self):
""" Query all the tracked states and determine current group state. """
self._state = STATE_UNKNOWN
for entity_id in self.tracking:
state = self.hass.states.get(entity_id)
if state is not None:
self._process_tracked_state(state)
def _state_changed_listener(self, entity_id, old_state, new_state):
""" Listener to receive state changes of tracked entities. """
self._process_tracked_state(new_state)
self.update_ha_state()
def _process_tracked_state(self, tr_state):
""" Updates group state based on a new state of a tracked entity. """
# We have not determined type of group yet
if self.group_on is None:
self.group_on, self.group_off = _get_group_on_off(new_state.state)
self.group_on, self.group_off = _get_group_on_off(tr_state.state)
if self.group_on is not None:
# New state of the group is going to be based on the first
# state that we can recognize
self.hass.states.set(
self.entity_id, new_state.state, self.state_attr)
self._state = tr_state.state
return
# There is already a group state
cur_gr_state = self.hass.states.get(self.entity_id).state
cur_gr_state = self._state
group_on, group_off = self.group_on, self.group_off
# if cur_gr_state = OFF and new_state = ON: set ON
# if cur_gr_state = ON and new_state = OFF: research
# if cur_gr_state = OFF and tr_state = ON: set ON
# if cur_gr_state = ON and tr_state = OFF: research
# else: ignore
if cur_gr_state == group_off and new_state.state == group_on:
if cur_gr_state == group_off and tr_state.state == group_on:
self._state = group_on
self.hass.states.set(
self.entity_id, group_on, self.state_attr)
elif cur_gr_state == group_on and tr_state.state == group_off:
elif (cur_gr_state == group_on and
new_state.state == group_off):
# Check if any of the other states is still on
# Set to off if no other states are on
if not any(self.hass.states.is_state(ent_id, group_on)
for ent_id in self.tracking if entity_id != ent_id):
self.hass.states.set(
self.entity_id, group_off, self.state_attr)
for ent_id in self.tracking
if tr_state.entity_id != ent_id):
self._state = group_off
def setup_group(hass, name, entity_ids, user_defined=True):
+5 -1
View File
@@ -50,8 +50,10 @@ def state_changes_during_period(start_time, end_time=None, entity_id=None):
result = defaultdict(list)
entity_ids = [entity_id] if entity_id is not None else None
# Get the states at the start time
for state in get_states(start_time):
for state in get_states(start_time, entity_ids):
state.last_changed = start_time
result[state.entity_id].append(state)
@@ -98,6 +100,7 @@ def get_state(point_in_time, entity_id, run=None):
return states[0] if states else None
# pylint: disable=unused-argument
def setup(hass, config):
""" Setup history hooks. """
hass.http.register_path(
@@ -113,6 +116,7 @@ def setup(hass, config):
return True
# pylint: disable=unused-argument
# pylint: disable=invalid-name
def _api_last_5_states(handler, path_match, data):
""" Return the last 5 states for an entity id as JSON. """
+209
View File
@@ -0,0 +1,209 @@
"""
Connects to an ISY-994 controller and loads relevant components to control its
devices. Also contains the base classes for ISY Sensors, Lights, and Switches.
"""
# system imports
import logging
from urllib.parse import urlparse
# addon library imports
import PyISY
# homeassistant imports
from homeassistant import bootstrap
from homeassistant.loader import get_component
from homeassistant.helpers import validate_config
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.const import (
CONF_HOST, CONF_USERNAME, CONF_PASSWORD, EVENT_PLATFORM_DISCOVERED,
ATTR_SERVICE, ATTR_DISCOVERED, ATTR_FRIENDLY_NAME)
# homeassistant constants
DOMAIN = "isy994"
DEPENDENCIES = []
DISCOVER_LIGHTS = "isy994.lights"
DISCOVER_SWITCHES = "isy994.switches"
DISCOVER_SENSORS = "isy994.sensors"
ISY = None
SENSOR_STRING = 'Sensor'
HIDDEN_STRING = '{HIDE ME}'
# setup logger
_LOGGER = logging.getLogger(__name__)
def setup(hass, config):
"""
Setup isy994 component.
This will automatically import associated lights, switches, and sensors.
"""
# pylint: disable=global-statement
# check for required values in configuration file
if not validate_config(config,
{DOMAIN: [CONF_HOST, CONF_USERNAME, CONF_PASSWORD]},
_LOGGER):
return False
# pull and parse standard configuration
user = config[DOMAIN][CONF_USERNAME]
password = config[DOMAIN][CONF_PASSWORD]
host = urlparse(config[DOMAIN][CONF_HOST])
addr = host.geturl()
if host.scheme == 'http':
addr = addr.replace('http://', '')
https = False
elif host.scheme == 'https':
addr = addr.replace('https://', '')
https = True
else:
_LOGGER.error('isy994 host value in configuration file is invalid.')
return False
port = host.port
addr = addr.replace(':{}'.format(port), '')
# pull and parse optional configuration
global SENSOR_STRING
global HIDDEN_STRING
SENSOR_STRING = str(config[DOMAIN].get('sensor_string', SENSOR_STRING))
HIDDEN_STRING = str(config[DOMAIN].get('hidden_string', HIDDEN_STRING))
# connect to ISY controller
global ISY
ISY = PyISY.ISY(addr, port, user, password, use_https=https, log=_LOGGER)
if not ISY.connected:
return False
# Load components for the devices in the ISY controller that we support
for comp_name, discovery in ((('sensor', DISCOVER_SENSORS),
('light', DISCOVER_LIGHTS),
('switch', DISCOVER_SWITCHES))):
component = get_component(comp_name)
bootstrap.setup_component(hass, component.DOMAIN, config)
hass.bus.fire(EVENT_PLATFORM_DISCOVERED,
{ATTR_SERVICE: discovery,
ATTR_DISCOVERED: {}})
ISY.auto_update = True
return True
class ISYDeviceABC(ToggleEntity):
""" Abstract Class for an ISY device within home assistant. """
_attrs = {}
_onattrs = []
_states = []
_dtype = None
_domain = None
_name = None
def __init__(self, node):
# setup properties
self.node = node
self.hidden = HIDDEN_STRING in self.raw_name
# track changes
self._change_handler = self.node.status. \
subscribe('changed', self.on_update)
def __del__(self):
""" cleanup subscriptions because it is the right thing to do. """
self._change_handler.unsubscribe()
@property
def domain(self):
""" Returns the domain of the entity. """
return self._domain
@property
def dtype(self):
""" Returns the data type of the entity (binary or analog). """
if self._dtype in ['analog', 'binary']:
return self._dtype
return 'binary' if self.unit_of_measurement is None else 'analog'
@property
def should_poll(self):
""" Tells Home Assistant not to poll this entity. """
return False
@property
def value(self):
""" returns the unclean value from the controller """
# pylint: disable=protected-access
return self.node.status._val
@property
def state_attributes(self):
""" Returns the state attributes for the node. """
attr = {ATTR_FRIENDLY_NAME: self.name}
for name, prop in self._attrs.items():
attr[name] = getattr(self, prop)
return attr
@property
def unique_id(self):
""" Returns the id of this isy sensor """
# pylint: disable=protected-access
return self.node._id
@property
def raw_name(self):
""" Returns the unclean node name. """
return str(self._name) \
if self._name is not None else str(self.node.name)
@property
def name(self):
""" Returns the cleaned name of the node. """
return self.raw_name.replace(HIDDEN_STRING, '').strip() \
.replace('_', ' ')
def update(self):
""" Update state of the sensor. """
# ISY objects are automatically updated by the ISY's event stream
pass
def on_update(self, event):
""" Handles the update received event. """
self.update_ha_state()
@property
def is_on(self):
""" Returns boolean response if the node is on. """
return bool(self.value)
@property
def is_open(self):
""" Returns boolean respons if the node is open. On = Open. """
return self.is_on
@property
def state(self):
""" Returns the state of the node. """
if len(self._states) > 0:
return self._states[0] if self.is_on else self._states[1]
return self.value
def turn_on(self, **kwargs):
""" turns the device on """
if self.domain is not 'sensor':
attrs = [kwargs.get(name) for name in self._onattrs]
self.node.on(*attrs)
else:
_LOGGER.error('ISY cannot turn on sensors.')
def turn_off(self, **kwargs):
""" turns the device off """
if self.domain is not 'sensor':
self.node.off()
else:
_LOGGER.error('ISY cannot turn off sensors.')
@property
def unit_of_measurement(self):
""" Returns the defined units of measurement or None. """
try:
return self.node.units
except AttributeError:
return None
+2 -1
View File
@@ -57,7 +57,7 @@ from homeassistant.helpers.entity_component import EntityComponent
import homeassistant.util as util
from homeassistant.const import (
STATE_ON, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID)
from homeassistant.components import group, discovery, wink
from homeassistant.components import group, discovery, wink, isy994
DOMAIN = "light"
@@ -92,6 +92,7 @@ LIGHT_PROFILES_FILE = "light_profiles.csv"
# Maps discovered services to their platforms
DISCOVERY_PLATFORMS = {
wink.DISCOVER_LIGHTS: 'wink',
isy994.DISCOVER_LIGHTS: 'isy994',
discovery.services.PHILIPS_HUE: 'hue',
}
+38
View File
@@ -0,0 +1,38 @@
""" Support for ISY994 lights. """
# system imports
import logging
# homeassistant imports
from homeassistant.components.isy994 import (ISYDeviceABC, ISY, SENSOR_STRING,
HIDDEN_STRING)
from homeassistant.components.light import ATTR_BRIGHTNESS
from homeassistant.const import STATE_ON, STATE_OFF
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the isy994 platform. """
logger = logging.getLogger(__name__)
devs = []
# verify connection
if ISY is None or not ISY.connected:
logger.error('A connection has not been made to the ISY controller.')
return False
# import dimmable nodes
for (path, node) in ISY.nodes:
if node.dimmable and SENSOR_STRING not in node.name:
if HIDDEN_STRING in path:
node.name += HIDDEN_STRING
devs.append(ISYLightDevice(node))
add_devices(devs)
class ISYLightDevice(ISYDeviceABC):
""" represents as isy light within home assistant. """
_domain = 'light'
_dtype = 'analog'
_attrs = {ATTR_BRIGHTNESS: 'value'}
_onattrs = [ATTR_BRIGHTNESS]
_states = [STATE_ON, STATE_OFF]
+100
View File
@@ -0,0 +1,100 @@
"""
components.modbus
~~~~~~~~~~~~~~~~~~~~~~~~~
Modbus component, using pymodbus (python3 branch)
typical declaration in configuration.yaml
#Modbus TCP
modbus:
type: tcp
host: 127.0.0.1
port: 2020
#Modbus RTU
modbus:
type: serial
method: rtu
port: /dev/ttyUSB0
baudrate: 9600
stopbits: 1
bytesize: 8
parity: N
"""
import logging
from homeassistant.const import (EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT_STOP)
# The domain of your component. Should be equal to the name of your component
DOMAIN = "modbus"
# List of component names (string) your component depends upon
DEPENDENCIES = []
# Type of network
MEDIUM = "type"
# if MEDIUM == "serial"
METHOD = "method"
SERIAL_PORT = "port"
BAUDRATE = "baudrate"
STOPBITS = "stopbits"
BYTESIZE = "bytesize"
PARITY = "parity"
# if MEDIUM == "tcp" or "udp"
HOST = "host"
IP_PORT = "port"
_LOGGER = logging.getLogger(__name__)
NETWORK = None
TYPE = None
def setup(hass, config):
""" Setup Modbus component. """
# Modbus connection type
# pylint: disable=global-statement, import-error
global TYPE
TYPE = config[DOMAIN][MEDIUM]
# Connect to Modbus network
# pylint: disable=global-statement, import-error
global NETWORK
if TYPE == "serial":
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
NETWORK = ModbusClient(method=config[DOMAIN][METHOD],
port=config[DOMAIN][SERIAL_PORT],
baudrate=config[DOMAIN][BAUDRATE],
stopbits=config[DOMAIN][STOPBITS],
bytesize=config[DOMAIN][BYTESIZE],
parity=config[DOMAIN][PARITY])
elif TYPE == "tcp":
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
NETWORK = ModbusClient(host=config[DOMAIN][HOST],
port=config[DOMAIN][IP_PORT])
elif TYPE == "udp":
from pymodbus.client.sync import ModbusUdpClient as ModbusClient
NETWORK = ModbusClient(host=config[DOMAIN][HOST],
port=config[DOMAIN][IP_PORT])
else:
return False
def stop_modbus(event):
""" Stop Modbus service"""
NETWORK.close()
def start_modbus(event):
""" Start Modbus service"""
NETWORK.connect()
hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, stop_modbus)
hass.bus.listen_once(EVENT_HOMEASSISTANT_START, start_modbus)
# Tells the bootstrapper that the component was succesfully initialized
return True
+2 -1
View File
@@ -6,7 +6,7 @@ Component to interface with various sensors that can be monitored.
import logging
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.components import wink, zwave
from homeassistant.components import wink, zwave, isy994
DOMAIN = 'sensor'
DEPENDENCIES = []
@@ -18,6 +18,7 @@ ENTITY_ID_FORMAT = DOMAIN + '.{}'
DISCOVERY_PLATFORMS = {
wink.DISCOVER_SENSORS: 'wink',
zwave.DISCOVER_SENSORS: 'zwave',
isy994.DISCOVER_SENSORS: 'isy994'
}
+90
View File
@@ -0,0 +1,90 @@
""" Support for ISY994 sensors. """
# system imports
import logging
# homeassistant imports
from homeassistant.components.isy994 import (ISY, ISYDeviceABC, SENSOR_STRING,
HIDDEN_STRING)
from homeassistant.const import (STATE_OPEN, STATE_CLOSED, STATE_HOME,
STATE_NOT_HOME, STATE_ON, STATE_OFF)
DEFAULT_HIDDEN_WEATHER = ['Temperature_High', 'Temperature_Low', 'Feels_Like',
'Temperature_Average', 'Pressure', 'Dew_Point',
'Gust_Speed', 'Evapotranspiration',
'Irrigation_Requirement', 'Water_Deficit_Yesterday',
'Elevation', 'Average_Temperature_Tomorrow',
'High_Temperature_Tomorrow',
'Low_Temperature_Tomorrow', 'Humidity_Tomorrow',
'Wind_Speed_Tomorrow', 'Gust_Speed_Tomorrow',
'Rain_Tomorrow', 'Snow_Tomorrow',
'Forecast_Average_Temperature',
'Forecast_High_Temperature',
'Forecast_Low_Temperature', 'Forecast_Humidity',
'Forecast_Rain', 'Forecast_Snow']
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the isy994 platform. """
# pylint: disable=protected-access
logger = logging.getLogger(__name__)
devs = []
# verify connection
if ISY is None or not ISY.connected:
logger.error('A connection has not been made to the ISY controller.')
return False
# import weather
if ISY.climate is not None:
for prop in ISY.climate._id2name:
if prop is not None:
prefix = HIDDEN_STRING \
if prop in DEFAULT_HIDDEN_WEATHER else ''
node = WeatherPseudoNode('ISY.weather.' + prop, prefix + prop,
getattr(ISY.climate, prop),
getattr(ISY.climate, prop + '_units'))
devs.append(ISYSensorDevice(node))
# import sensor nodes
for (path, node) in ISY.nodes:
if SENSOR_STRING in node.name:
if HIDDEN_STRING in path:
node.name += HIDDEN_STRING
devs.append(ISYSensorDevice(node, [STATE_ON, STATE_OFF]))
# import sensor programs
for (folder_name, states) in (
('HA.locations', [STATE_HOME, STATE_NOT_HOME]),
('HA.sensors', [STATE_OPEN, STATE_CLOSED]),
('HA.states', [STATE_ON, STATE_OFF])):
try:
folder = ISY.programs['My Programs'][folder_name]
except KeyError:
# folder does not exist
pass
else:
for _, _, node_id in folder.children:
node = folder[node_id].leaf
devs.append(ISYSensorDevice(node, states))
add_devices(devs)
class WeatherPseudoNode(object):
""" This class allows weather variable to act as regular nodes. """
# pylint: disable=too-few-public-methods
def __init__(self, device_id, name, status, units=None):
self._id = device_id
self.name = name
self.status = status
self.units = units
class ISYSensorDevice(ISYDeviceABC):
""" represents a isy sensor within home assistant. """
_domain = 'sensor'
def __init__(self, node, states=None):
super().__init__(node)
self._states = states or []
+136
View File
@@ -0,0 +1,136 @@
"""
Support for Modbus sensors.
Configuration:
To use the Modbus sensors you will need to add something like the following to
your config/configuration.yaml
sensor:
platform: modbus
slave: 1
registers:
16:
name: My integer sensor
unit: C
24:
bits:
0:
name: My boolean sensor
2:
name: My other boolean sensor
VARIABLES:
- "slave" = slave number (ignored and can be omitted if not serial Modbus)
- "unit" = unit to attach to value (optional, ignored for boolean sensors)
- "registers" contains a list of relevant registers to read from
it can contain a "bits" section, listing relevant bits
- each named register will create an integer sensor
- each named bit will create a boolean sensor
"""
import logging
import homeassistant.components.modbus as modbus
from homeassistant.helpers.entity import Entity
from homeassistant.const import (
TEMP_CELCIUS, TEMP_FAHRENHEIT,
STATE_ON, STATE_OFF)
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Read config and create Modbus devices """
sensors = []
slave = config.get("slave", None)
if modbus.TYPE == "serial" and not slave:
_LOGGER.error("No slave number provided for serial Modbus")
return False
registers = config.get("registers")
for regnum, register in registers.items():
if register.get("name"):
sensors.append(ModbusSensor(register.get("name"),
slave,
regnum,
None,
register.get("unit")))
if register.get("bits"):
bits = register.get("bits")
for bitnum, bit in bits.items():
if bit.get("name"):
sensors.append(ModbusSensor(bit.get("name"),
slave,
regnum,
bitnum))
add_devices(sensors)
class ModbusSensor(Entity):
# pylint: disable=too-many-arguments
""" Represents a Modbus Sensor """
def __init__(self, name, slave, register, bit=None, unit=None):
self._name = name
self.slave = int(slave) if slave else 1
self.register = int(register)
self.bit = int(bit) if bit else None
self._value = None
self._unit = unit
def __str__(self):
return "%s: %s" % (self.name, self.state)
@property
def should_poll(self):
""" We should poll, because slaves are not allowed to
initiate communication on Modbus networks"""
return True
@property
def unique_id(self):
""" Returns a unique id. """
return "MODBUS-SENSOR-{}-{}-{}".format(self.slave,
self.register,
self.bit)
@property
def state(self):
""" Returns the state of the sensor. """
if self.bit:
return STATE_ON if self._value else STATE_OFF
else:
return self._value
@property
def name(self):
""" Get the name of the sensor. """
return self._name
@property
def unit_of_measurement(self):
""" Unit of measurement of this entity, if any. """
if self._unit == "C":
return TEMP_CELCIUS
elif self._unit == "F":
return TEMP_FAHRENHEIT
else:
return self._unit
@property
def state_attributes(self):
attr = super().state_attributes
return attr
def update(self):
result = modbus.NETWORK.read_holding_registers(unit=self.slave,
address=self.register,
count=1)
val = 0
for i, res in enumerate(result.registers):
val += res * (2**(i*16))
if self.bit:
self._value = val & (0x0001 << self.bit)
else:
self._value = val
@@ -0,0 +1,186 @@
"""
homeassistant.components.sensor.transmission
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Monitors Transmission BitTorrent client API
Configuration:
To use the Transmission sensor you will need to add something like the
following to your config/configuration.yaml
sensor:
platform: transmission
name: Transmission
host: 192.168.1.26
port: 9091
username: YOUR_USERNAME
password: YOUR_PASSWORD
monitored_variables:
- type: 'current_status'
- type: 'download_speed'
- type: 'upload_speed'
VARIABLES:
host
*Required
This is the IP address of your Transmission Daemon
Example: 192.168.1.32
port
*Optional
The port your Transmission daemon uses, defaults to 9091
Example: 8080
username
*Required
Your Transmission username
password
*Required
Your Transmission password
name
*Optional
The name to use when displaying this Transmission instance
monitored_variables
*Required
An array specifying the variables to monitor.
These are the variables for the monitored_variables array:
type
*Required
The variable you wish to monitor, see the configuration example above for a
list of all available variables
"""
from homeassistant.util import Throttle
from datetime import timedelta
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
from homeassistant.helpers.entity import Entity
# pylint: disable=no-name-in-module, import-error
import transmissionrpc
from transmissionrpc.error import TransmissionError
import logging
SENSOR_TYPES = {
'current_status': ['Status', ''],
'download_speed': ['Down Speed', 'MB/s'],
'upload_speed': ['Up Speed', 'MB/s']
}
_LOGGER = logging.getLogger(__name__)
_THROTTLED_REFRESH = None
# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the sensors """
host = config.get(CONF_HOST)
username = config.get(CONF_USERNAME, None)
password = config.get(CONF_PASSWORD, None)
port = config.get('port', 9091)
name = config.get("name", "Transmission")
if not host:
_LOGGER.error('Missing config variable %s', CONF_HOST)
return False
# import logging
# logging.getLogger('transmissionrpc').setLevel(logging.DEBUG)
transmission_api = transmissionrpc.Client(
host, port=port, user=username, password=password)
try:
transmission_api.session_stats()
except TransmissionError:
_LOGGER.exception("Connection to Transmission API failed.")
return False
# pylint: disable=global-statement
global _THROTTLED_REFRESH
_THROTTLED_REFRESH = Throttle(timedelta(seconds=1))(
transmission_api.session_stats)
dev = []
for variable in config['monitored_variables']:
if variable['type'] not in SENSOR_TYPES:
_LOGGER.error('Sensor type: "%s" does not exist', variable['type'])
else:
dev.append(TransmissionSensor(
variable['type'], transmission_api, name))
add_devices(dev)
class TransmissionSensor(Entity):
""" A Transmission sensor """
def __init__(self, sensor_type, transmission_client, client_name):
self._name = SENSOR_TYPES[sensor_type][0]
self.transmission_client = transmission_client
self.type = sensor_type
self.client_name = client_name
self._state = None
self._unit_of_measurement = SENSOR_TYPES[sensor_type][1]
@property
def name(self):
return self.client_name + ' ' + self._name
@property
def state(self):
""" Returns the state of the device. """
return self._state
@property
def unit_of_measurement(self):
""" Unit of measurement of this entity, if any. """
return self._unit_of_measurement
def refresh_transmission_data(self):
""" Calls the throttled Transmission refresh method. """
if _THROTTLED_REFRESH is not None:
try:
_THROTTLED_REFRESH()
except TransmissionError:
_LOGGER.exception(
self.name + " Connection to Transmission API failed."
)
def update(self):
""" Gets the latest from Transmission and updates the state. """
self.refresh_transmission_data()
if self.type == 'current_status':
if self.transmission_client.session:
upload = self.transmission_client.session.uploadSpeed
download = self.transmission_client.session.downloadSpeed
if upload > 0 and download > 0:
self._state = 'Up/Down'
elif upload > 0 and download == 0:
self._state = 'Seeding'
elif upload == 0 and download > 0:
self._state = 'Downloading'
else:
self._state = 'Idle'
else:
self._state = 'Unknown'
if self.transmission_client.session:
if self.type == 'download_speed':
mb_spd = float(self.transmission_client.session.downloadSpeed)
mb_spd = mb_spd / 1024 / 1024
self._state = round(mb_spd, 2 if mb_spd < 0.1 else 1)
elif self.type == 'upload_speed':
mb_spd = float(self.transmission_client.session.uploadSpeed)
mb_spd = mb_spd / 1024 / 1024
self._state = round(mb_spd, 2 if mb_spd < 0.1 else 1)
+2 -1
View File
@@ -10,7 +10,7 @@ from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.const import (
STATE_ON, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID)
from homeassistant.components import group, discovery, wink
from homeassistant.components import group, discovery, wink, isy994
DOMAIN = 'switch'
DEPENDENCIES = []
@@ -30,6 +30,7 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
DISCOVERY_PLATFORMS = {
discovery.services.BELKIN_WEMO: 'wemo',
wink.DISCOVER_SWITCHES: 'wink',
isy994.DISCOVER_SWITCHES: 'isy994',
}
_LOGGER = logging.getLogger(__name__)
+2 -2
View File
@@ -1,4 +1,4 @@
""" Demo platform that has two fake switchces. """
""" Demo platform that has two fake switches. """
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.const import STATE_ON, STATE_OFF, DEVICE_DEFAULT_NAME
@@ -30,7 +30,7 @@ class DemoSwitch(ToggleEntity):
@property
def state(self):
""" Returns the name of the device if any. """
""" Returns the state of the device if any. """
return self._state
@property
+82
View File
@@ -0,0 +1,82 @@
""" Support for ISY994 switch. """
# system imports
import logging
# homeassistant imports
from homeassistant.components.isy994 import (ISY, ISYDeviceABC, SENSOR_STRING,
HIDDEN_STRING)
from homeassistant.const import STATE_ON, STATE_OFF # STATE_OPEN, STATE_CLOSED
# The frontend doesn't seem to fully support the open and closed states yet.
# Once it does, the HA.doors programs should report open and closed instead of
# off and on. It appears that on should be open and off should be closed.
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the isy994 platform. """
# pylint: disable=too-many-locals
logger = logging.getLogger(__name__)
devs = []
# verify connection
if ISY is None or not ISY.connected:
logger.error('A connection has not been made to the ISY controller.')
return False
# import not dimmable nodes and groups
for (path, node) in ISY.nodes:
if not node.dimmable and SENSOR_STRING not in node.name:
if HIDDEN_STRING in path:
node.name += HIDDEN_STRING
devs.append(ISYSwitchDevice(node))
# import ISY doors programs
for folder_name, states in (('HA.doors', [STATE_ON, STATE_OFF]),
('HA.switches', [STATE_ON, STATE_OFF])):
try:
folder = ISY.programs['My Programs'][folder_name]
except KeyError:
# HA.doors folder does not exist
pass
else:
for dtype, name, node_id in folder.children:
if dtype is 'folder':
custom_switch = folder[node_id]
try:
actions = custom_switch['actions'].leaf
assert actions.dtype == 'program', 'Not a program'
node = custom_switch['status'].leaf
except (KeyError, AssertionError):
pass
else:
devs.append(ISYProgramDevice(name, node, actions,
states))
add_devices(devs)
class ISYSwitchDevice(ISYDeviceABC):
""" represents as isy light within home assistant. """
_domain = 'switch'
_dtype = 'binary'
_states = [STATE_ON, STATE_OFF]
class ISYProgramDevice(ISYSwitchDevice):
""" represents a door that can be manipulated within home assistant. """
_domain = 'switch'
_dtype = 'binary'
def __init__(self, name, node, actions, states):
super().__init__(node)
self._states = states
self._name = name
self.action_node = actions
def turn_on(self, **kwargs):
""" turns the device on/closes the device """
self.action_node.runThen()
def turn_off(self, **kwargs):
""" turns the device off/opens the device """
self.action_node.runElse()
+121
View File
@@ -0,0 +1,121 @@
"""
Support for Modbus switches.
Configuration:
To use the Modbus switches you will need to add something like the following to
your config/configuration.yaml
sensor:
platform: modbus
slave: 1
registers:
24:
bits:
0:
name: My switch
2:
name: My other switch
VARIABLES:
- "slave" = slave number (ignored and can be omitted if not serial Modbus)
- "registers" contains a list of relevant registers to read from
- it must contain a "bits" section, listing relevant bits
- each named bit will create a switch
"""
import logging
import homeassistant.components.modbus as modbus
from homeassistant.helpers.entity import ToggleEntity
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Read config and create Modbus devices """
switches = []
slave = config.get("slave", None)
if modbus.TYPE == "serial" and not slave:
_LOGGER.error("No slave number provided for serial Modbus")
return False
registers = config.get("registers")
for regnum, register in registers.items():
bits = register.get("bits")
for bitnum, bit in bits.items():
if bit.get("name"):
switches.append(ModbusSwitch(bit.get("name"),
slave,
regnum,
bitnum))
add_devices(switches)
class ModbusSwitch(ToggleEntity):
""" Represents a Modbus Switch """
def __init__(self, name, slave, register, bit):
self._name = name
self.slave = int(slave) if slave else 1
self.register = int(register)
self.bit = int(bit)
self._is_on = None
self.register_value = None
def __str__(self):
return "%s: %s" % (self.name, self.state)
@property
def should_poll(self):
""" We should poll, because slaves are not allowed to
initiate communication on Modbus networks"""
return True
@property
def unique_id(self):
""" Returns a unique id. """
return "MODBUS-SWITCH-{}-{}-{}".format(self.slave,
self.register,
self.bit)
@property
def is_on(self):
""" Returns True if switch is on. """
return self._is_on
@property
def name(self):
""" Get the name of the switch. """
return self._name
@property
def state_attributes(self):
attr = super().state_attributes
return attr
def turn_on(self, **kwargs):
if self.register_value is None:
self.update()
val = self.register_value | (0x0001 << self.bit)
modbus.NETWORK.write_register(unit=self.slave,
address=self.register,
value=val)
def turn_off(self, **kwargs):
if self.register_value is None:
self.update()
val = self.register_value & ~(0x0001 << self.bit)
modbus.NETWORK.write_register(unit=self.slave,
address=self.register,
value=val)
def update(self):
result = modbus.NETWORK.read_holding_registers(unit=self.slave,
address=self.register,
count=1)
val = 0
for i, res in enumerate(result.registers):
val += res * (2**(i*16))
self.register_value = val
self._is_on = (val & (0x0001 << self.bit) > 0)
+4
View File
@@ -11,6 +11,7 @@ CONF_LONGITUDE = "longitude"
CONF_TEMPERATURE_UNIT = "temperature_unit"
CONF_NAME = "name"
CONF_TIME_ZONE = "time_zone"
CONF_VISIBILITY = "visibility"
CONF_PLATFORM = "platform"
CONF_HOST = "host"
@@ -86,6 +87,9 @@ ATTR_TRIPPED = "device_tripped"
# time the device was tripped
ATTR_LAST_TRIP_TIME = "last_tripped_time"
# For all entity's, this hold whether or not it should be hidden
ATTR_HIDDEN = "hidden"
# #### SERVICES ####
SERVICE_HOMEASSISTANT_STOP = "stop"
+45 -7
View File
@@ -8,16 +8,22 @@ Provides ABC for entities in HA.
from homeassistant import NoEntitySpecifiedError
from homeassistant.const import (
ATTR_FRIENDLY_NAME, ATTR_UNIT_OF_MEASUREMENT, STATE_ON, STATE_OFF,
DEVICE_DEFAULT_NAME, TEMP_CELCIUS, TEMP_FAHRENHEIT)
ATTR_FRIENDLY_NAME, ATTR_UNIT_OF_MEASUREMENT, ATTR_HIDDEN, STATE_ON,
STATE_OFF, DEVICE_DEFAULT_NAME, TEMP_CELCIUS, TEMP_FAHRENHEIT)
# Dict mapping entity_id to a boolean that overwrites the hidden property
_OVERWRITE_HIDDEN = {}
class Entity(object):
""" ABC for Home Assistant entities. """
# pylint: disable=no-self-use
hass = None
entity_id = None
_hidden = False
# SAFE TO OVERWRITE
# The properties and methods here are safe to overwrite when inherting this
# class. These may be used to customize the behavior of the entity.
@property
def should_poll(self):
@@ -52,6 +58,20 @@ class Entity(object):
""" Unit of measurement of this entity, if any. """
return None
@property
def hidden(self):
""" Suggestion if the entity should be hidden from UIs. """
return self._hidden
@hidden.setter
def hidden(self, val):
""" Sets the suggestion for visibility. """
self._hidden = bool(val)
def update(self):
""" Retrieve latest state. """
pass
# DEPRECATION NOTICE:
# Device is moving from getters to properties.
# For now the new properties will call the old functions
@@ -69,9 +89,13 @@ class Entity(object):
""" Returns optional state attributes. """
return None
def update(self):
""" Retrieve latest state. """
pass
# DO NOT OVERWRITE
# These properties and methods are either managed by Home Assistant or they
# are used to perform a very specific function. Overwriting these may
# produce undesirable effects in the entity's operation.
hass = None
entity_id = None
def update_ha_state(self, force_refresh=False):
"""
@@ -97,6 +121,9 @@ class Entity(object):
if ATTR_UNIT_OF_MEASUREMENT not in attr and self.unit_of_measurement:
attr[ATTR_UNIT_OF_MEASUREMENT] = self.unit_of_measurement
if _OVERWRITE_HIDDEN.get(self.entity_id, self.hidden):
attr[ATTR_HIDDEN] = True
# Convert temperature if we detect one
if attr.get(ATTR_UNIT_OF_MEASUREMENT) in (TEMP_CELCIUS,
TEMP_FAHRENHEIT):
@@ -115,6 +142,17 @@ class Entity(object):
def __repr__(self):
return "<Entity {}: {}>".format(self.name, self.state)
@staticmethod
def overwrite_hidden(entity_id, hidden):
"""
Overwrite the hidden property of an entity.
Set hidden to None to remove any overwritten value in place.
"""
if hidden is None:
_OVERWRITE_HIDDEN.pop(entity_id, None)
else:
_OVERWRITE_HIDDEN[entity_id.lower()] = hidden
class ToggleEntity(Entity):
""" ABC for entities that can be turned on and off. """
+7 -1
View File
@@ -34,8 +34,14 @@ python-nest>=2.1
# z-wave
pydispatcher>=2.0.5
# isy994
PyISY>=1.0.2
# sensor.systemmonitor
psutil>=2.2.1
#pushover notifications
python-pushover>=0.2
python-pushover>=0.2
# Transmission Torrent Client
transmissionrpc>=0.11
+1 -1
View File
@@ -34,5 +34,5 @@ if [ $(command -v md5) ]; then
elif [ $(command -v md5sum) ]; then
echo 'VERSION = "'`md5sum www_static/frontend.html | cut -c-32`'"' >> version.py
else
echo 'Could not find a MD5 utility'
echo 'Could not find an MD5 utility'
fi
+97
View File
@@ -0,0 +1,97 @@
#! /usr/bin/python
"""
Query the Home Assistant API for available entities then print them and any
desired attributes to the screen.
"""
import sys
import getpass
import argparse
try:
from urllib2 import urlopen
PYTHON = 2
except ImportError:
from urllib.request import urlopen
PYTHON = 3
import json
def main(password, askpass, attrs, address, port):
""" fetch Home Assistant api json page and post process """
# ask for password
if askpass:
password = getpass.getpass('Home Assistant API Password: ')
# fetch API result
url = mk_url(address, port, password)
response = urlopen(url).read()
if PYTHON == 3:
response = response.decode('utf-8')
data = json.loads(response)
# parse data
output = {'entity_id': []}
output.update([(attr, []) for attr in attrs])
for item in data:
output['entity_id'].append(item['entity_id'])
for attr in attrs:
output[attr].append(item['attributes'].get(attr, ''))
# output data
print_table(output, ['entity_id'] + attrs)
def print_table(data, columns):
""" format and print a table of data from a dictionary """
# get column lengths
lengths = {}
for key, value in data.items():
lengths[key] = max([len(str(val)) for val in value] + [len(key)])
# print header
for item in columns:
itemup = item.upper()
sys.stdout.write(itemup + ' ' * (lengths[item] - len(item) + 4))
sys.stdout.write('\n')
# print body
for ind in range(len(data[columns[0]])):
for item in columns:
val = str(data[item][ind])
sys.stdout.write(val + ' ' * (lengths[item] - len(val) + 4))
sys.stdout.write("\n")
def mk_url(address, port, password):
""" construct the url call for the api states page """
url = ''
if address.startswith('http://'):
url += address
else:
url += 'http://' + address
url += ':' + port + '/api/states?'
if password is not None:
url += 'api_password=' + password
return url
if __name__ == "__main__":
all_options = {'password': None, 'askpass': False, 'attrs': [],
'address': 'localhost', 'port': '8123'}
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('attrs', metavar='ATTRIBUTE', type=str, nargs='*',
help='an attribute to read from the state')
parser.add_argument('--password', dest='password', default=None,
type=str, help='API password for the HA server')
parser.add_argument('--ask-password', dest='askpass', default=False,
action='store_const', const=True,
help='prompt for HA API password')
parser.add_argument('--addr', dest='address',
default='localhost', type=str,
help='address of the HA server')
parser.add_argument('--port', dest='port', default='8123',
type=str, help='port that HA is hosting on')
args = parser.parse_args()
main(args.password, args.askpass, args.attrs, args.address, args.port)
+78
View File
@@ -0,0 +1,78 @@
#!/bin/sh
# To script is for running Home Assistant as a service and automatically starting it on boot.
# Assuming you have cloned the HA repo into /home/pi/Apps/home-assistant adjust this path if necessary
# This also assumes you installed HA on your raspberry pi using the instructions here:
# https://home-assistant.io/getting-started/
#
# To install to the following:
# sudo cp /home/pi/Apps/home-assistant/scripts/homeassistant-pi.sh /etc/init.d/homeassistant.sh
# sudo chmod +x /etc/init.d/homeassistant.sh
# sudo chown root:root /etc/init.d/homeassistant.sh
#
# If you want HA to start on boot also run the following:
# sudo update-rc.d homeassistant.sh defaults
# sudo update-rc.d homeassistant.sh enable
#
# You should now be able to start HA by running
# sudo /etc/init.d/homeassistant.sh start
### BEGIN INIT INFO
# Provides: myservice
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Put a short description of the service here
# Description: Put a long description of the service here
### END INIT INFO
# Change the next 3 lines to suit where you install your script and what you want to call it
DIR=/home/pi/Apps/home-assistant
DAEMON="/home/pi/.pyenv/shims/python3 -m homeassistant"
DAEMON_NAME=homeassistant
# Add any command line options for your daemon here
DAEMON_OPTS=""
# This next line determines what user the script runs as.
# Root generally not recommended but necessary if you are using the Raspberry Pi GPIO from Python.
DAEMON_USER=pi
# The process ID of the script when it runs is stored here:
PIDFILE=/var/run/$DAEMON_NAME.pid
. /lib/lsb/init-functions
do_start () {
log_daemon_msg "Starting system $DAEMON_NAME daemon"
start-stop-daemon --start --background --chdir $DIR --pidfile $PIDFILE --make-pidfile --user $DAEMON_USER --chuid $DAEMON_USER --startas $DAEMON -- $DAEMON_OPTS
log_end_msg $?
}
do_stop () {
log_daemon_msg "Stopping system $DAEMON_NAME daemon"
start-stop-daemon --stop --pidfile $PIDFILE --retry 10
log_end_msg $?
}
case "$1" in
start|stop)
do_${1}
;;
restart|reload|force-reload)
do_stop
do_start
;;
status)
status_of_proc "$DAEMON_NAME" "$DAEMON" && exit 0 || exit $?
;;
*)
echo "Usage: /etc/init.d/$DAEMON_NAME {start|stop|restart|status}"
exit 1
;;
esac
exit 0
+3 -3
View File
@@ -54,7 +54,7 @@ class TestComponentsGroup(unittest.TestCase):
self.hass, 'light_and_nothing',
['light.Bowl', 'non.existing'])
self.assertEqual(STATE_ON, grp.state.state)
self.assertEqual(STATE_ON, grp.state)
def test_setup_group_with_non_groupable_states(self):
self.hass.states.set('cast.living_room', "Plex")
@@ -64,13 +64,13 @@ class TestComponentsGroup(unittest.TestCase):
self.hass, 'chromecasts',
['cast.living_room', 'cast.bedroom'])
self.assertEqual(STATE_UNKNOWN, grp.state.state)
self.assertEqual(STATE_UNKNOWN, grp.state)
def test_setup_empty_group(self):
""" Try to setup an empty group. """
grp = group.setup_group(self.hass, 'nothing', [])
self.assertEqual(STATE_UNKNOWN, grp.state.state)
self.assertEqual(STATE_UNKNOWN, grp.state)
def test_monitor_group(self):
""" Test if the group keeps track of states. """
+60
View File
@@ -0,0 +1,60 @@
"""
tests.test_helper_entity
~~~~~~~~~~~~~~~~~~~~~~~~
Tests the entity helper.
"""
# pylint: disable=protected-access,too-many-public-methods
import unittest
import homeassistant as ha
import homeassistant.helpers.entity as entity
from homeassistant.const import ATTR_HIDDEN
class TestHelpersEntity(unittest.TestCase):
""" Tests homeassistant.helpers.entity module. """
def setUp(self): # pylint: disable=invalid-name
""" Init needed objects. """
self.entity = entity.Entity()
self.entity.entity_id = 'test.overwrite_hidden_true'
self.hass = self.entity.hass = ha.HomeAssistant()
self.entity.update_ha_state()
def tearDown(self): # pylint: disable=invalid-name
""" Stop down stuff we started. """
self.hass.stop()
entity.Entity.overwrite_hidden(self.entity.entity_id, None)
def test_default_hidden_not_in_attributes(self):
""" Test that the default hidden property is set to False. """
self.assertNotIn(
ATTR_HIDDEN,
self.hass.states.get(self.entity.entity_id).attributes)
def test_setting_hidden_to_true(self):
self.entity.hidden = True
self.entity.update_ha_state()
state = self.hass.states.get(self.entity.entity_id)
self.assertTrue(state.attributes.get(ATTR_HIDDEN))
def test_overwriting_hidden_property_to_true(self):
""" Test we can overwrite hidden property to True. """
entity.Entity.overwrite_hidden(self.entity.entity_id, True)
self.entity.update_ha_state()
state = self.hass.states.get(self.entity.entity_id)
self.assertTrue(state.attributes.get(ATTR_HIDDEN))
def test_overwriting_hidden_property_to_false(self):
""" Test we can overwrite hidden property to True. """
entity.Entity.overwrite_hidden(self.entity.entity_id, False)
self.entity.hidden = True
self.entity.update_ha_state()
self.assertNotIn(
ATTR_HIDDEN,
self.hass.states.get(self.entity.entity_id).attributes)