Fix some frontend bugs

This commit is contained in:
Paulus Schoutsen committed 2015-02-07 21:37:50 -08:00
1 parent 09bf64db42
commit f8fc8c888f
6 files changed
+38 -33

No files matched your search

+1 -1
View File
@@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "be9fb38e992137e8e3b83e4ff91f9c7c"
VERSION = "db6b9c263c4be99af5b25b8c1cb20e57"
@@ -119,7 +119,7 @@ b.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.loc
{{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><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 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-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="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:"Entity"});dataTable.addColumn({type:"string",id:"State"});dataTable.addColumn({type:"date",id:"Start"});dataTable.addColumn({type:"date",id:"End"});var stateTimeToDate=function(time){if(!time)return new Date;return window.hass.util.parseTime(time).toDate()};var addRow=function(baseState,state,tillState){tillState=tillState||{};dataTable.addRow([baseState.entityDisplay,state.state,stateTimeToDate(state.last_changed),stateTimeToDate(tillState.last_changed)])};var stateHistoLine truncated
</div></div></div></template><script>Polymer("state-card-thermostat",{});</script></polymer-element><polymer-element name="state-card-configurator" 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 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-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="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:"Entity"});dataTable.addColumn({type:"string",id:"State"});dataTable.addColumn({type:"date",id:"Start"});dataTable.addColumn({type:"date",id:"End"});var addRow=function(entityDisplay,stateStr,start,end){dataTable.addRow([entityDisplay,stateStr,start,end])};if(this.stateHistory.length===0){return}var stateHistory;if(_.isArray(this.stateHistory[0])){stateHistory=this.stateHistory}else{stateHistory=[this.stateHistory]}stateHistory.forEach(function(stateInfo){if(stateInfo.lengLine truncated
{{key}}
</div><div class="value">
{{stateObj.attributes[key]}}
@@ -172,15 +172,15 @@ b.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.loc
Setting {{stateObj.attributes.next_setting | relativeHATime}}
</div><div class="value">
{{stateObj.attributes.next_setting | HATimeStripDate}}
</div></div></div></template><script>Polymer("more-info-sun",{stateObjChanged:function(){var rising=window.hass.util.parseTime(this.stateObj.attributes.next_rising);var setting=window.hass.util.parseTime(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="paper-button-base" tabindex="0" assetpath="polymer/bower_components/paper-button/"><script>(function(){var p={eventDelegates:{down:"downAction",up:"upAction"},toggleBackground:function(){if(this.active){if(!this.$.bg){var bg=document.createElement("div");bg.setAttribute("id","bg");bg.setAttribute("fit","");bg.style.opacity=.25;this.$.bg=bg;this.shadowRoot.insertBefore(bg,this.shadowRoot.firstChild)}this.$.bg.style.backgroundColor=getComputedStyle(this).color}else{if(this.$.bg){this.$.bg.style.backgroundColor=""}}},activeChanged:function(){this.super();if(this.toggle&&(!this.lastEvent||this.matches(":host-context([noink])"))){this.toggleBackground()}},pressedChanged:function(){this.super();if(!this.lastEvent){return}if(this.$.ripple&&!this.hasAttribute("noink")){if(this.pressed){this.$.ripple.downAction(this.lastEvent)}else{this.$.ripple.upAction()}}this.adjustZ()},focusedChanged:function(){this.adjustZ()},disabledChanged:function(){this._disabledChanged();this.adjustZ()},recenteringTouchChanged:function(){if(this.$.ripple){this.$.ripple.classList.toggle("recenteringTouch",this.recenteringTouch)}},fillChanged:function(){if(this.$.ripple){this.$.ripple.classList.toggle("fill",this.fill)}},adjustZ:function(){if(!this.$.shadow){return}if(this.active){this.$.shadow.setZ(2)}else if(this.disabled){this.$.shadow.setZ(0)}else if(this.focused){this.$.shadow.setZ(3)}else{this.$.shadow.setZ(1)}},downAction:function(e){this._downAction();if(this.hasAttribute("noink")){return}this.lastEvent=e;if(!this.$.ripple){var ripple=document.createElement("paper-ripple");ripple.setAttribute("id","ripple");ripple.setAttribute("fit","");if(this.recenteringTouch){ripple.classList.add("recenteringTouch")}if(!this.fill){ripple.classList.add("circle")}this.$.ripple=ripple;this.shadowRoot.insertBefore(ripple,this.shadowRoot.firstChild)}},upAction:function(){this._upAction();if(this.toggle){this.toggleBackground();if(this.$.ripple){this.$.ripple.cancel()}}}};Polymer.mixin2(p,Polymer.CoreFocusable);Polymer(p)})();</script></polymer-element><polymer-element name="paper-button" extends="paper-button-base" attributes="raised recenteringTouch fill" role="button" assetpath="polymer/bower_components/paper-button/"><template><style>:host{display:inline-block;position:relative;box-sizing:border-box;min-width:5.14em;margin:0 .29em;background:0 0;text-align:center;font:inherit;text-transform:uppercase;outline:0;border-radius:3px;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;cursor:pointer;z-index:0}:host([disabled]){background:#eaeaea;color:#a8a8a8;cursor:auto;pointer-events:none}::content *{text-transform:inherit}#bg,#shadow{border-radius:inherit}#ripple{pointer-events:none;z-index:-1}.button-content{padding:.7em .57em}polyfill-next-selector{content:'.button-content > a'}::content>a{height:100%;padding:.7em .57em;margin:-.7em -.57em;-ms-flex:1 1 0;-webkit-flex:1;flex:1;-webkit-flex-basis:0;flex-basis:0}</style><template if="{{raised}}"><paper-shadow id="shadow" fit="" animated=""></paper-shadow></template><div class="button-content" relative="" layout="" horizontal="" center-center=""><content></content></div><core-a11y-keys keys="space enter" target="{{}}" on-keys-pressed="{{_activate}}"></core-a11y-keys></template><script>Polymer("paper-button",{publish:{raised:false,recenteringTouch:false,fill:true},_activate:function(){this.click();this.fire("tap");if(!this.pressed){var bcr=this.getBoundingClientRect();var x=bcr.left+bcr.width/2;var y=bcr.top+bcr.height/2;this.downAction({x:x,y:y});var fn=function fn(){this.upAction();this.removeEventListener("keyup",fn)}.bind(this);this.addEventListener("keyup",fn)}}});</script></polymer-element><polymer-element name="paper-spinner" attributes="active alt" role="progressbar" assetpath="polymer/bower_components/paper-spinner/"><template><style>:host{display:inline-block;position:relative;width:28px;height:28px}#spinnerContainer{width:100%;height:100%}#spinnerContainer.active{-webkit-animation:container-rotate 1568ms linear infinite;animation:container-rotate 1568ms linear infinite}@-webkit-keyframes container-rotate{to{-webkit-transform:rotate(360deg)}}@keyframes container-rotate{to{transform:rotate(360deg)}}.spinner-layer{position:absolute;width:100%;height:100%;opacity:0}.blue{border-color:#4285f4}.red{border-color:#db4437}.yellow{border-color:#f4b400}.green{border-color:#0f9d58}.active .spinner-layer.blue{-webkit-animation:fill-unfill-rotate 5332ms cubic-bezier(0.4,0,.2,1) infinite both,blue-fade-in-out 5332ms cubic-bezier(0.4,0,.2,1) infinite both;animation:fill-unLine truncated
</div></div></div></template><script>Polymer("more-info-sun",{stateObjChanged:function(){var rising=window.hass.util.parseDateTime(this.stateObj.attributes.next_rising);var setting=window.hass.util.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="paper-button-base" tabindex="0" assetpath="polymer/bower_components/paper-button/"><script>(function(){var p={eventDelegates:{down:"downAction",up:"upAction"},toggleBackground:function(){if(this.active){if(!this.$.bg){var bg=document.createElement("div");bg.setAttribute("id","bg");bg.setAttribute("fit","");bg.style.opacity=.25;this.$.bg=bg;this.shadowRoot.insertBefore(bg,this.shadowRoot.firstChild)}this.$.bg.style.backgroundColor=getComputedStyle(this).color}else{if(this.$.bg){this.$.bg.style.backgroundColor=""}}},activeChanged:function(){this.super();if(this.toggle&&(!this.lastEvent||this.matches(":host-context([noink])"))){this.toggleBackground()}},pressedChanged:function(){this.super();if(!this.lastEvent){return}if(this.$.ripple&&!this.hasAttribute("noink")){if(this.pressed){this.$.ripple.downAction(this.lastEvent)}else{this.$.ripple.upAction()}}this.adjustZ()},focusedChanged:function(){this.adjustZ()},disabledChanged:function(){this._disabledChanged();this.adjustZ()},recenteringTouchChanged:function(){if(this.$.ripple){this.$.ripple.classList.toggle("recenteringTouch",this.recenteringTouch)}},fillChanged:function(){if(this.$.ripple){this.$.ripple.classList.toggle("fill",this.fill)}},adjustZ:function(){if(!this.$.shadow){return}if(this.active){this.$.shadow.setZ(2)}else if(this.disabled){this.$.shadow.setZ(0)}else if(this.focused){this.$.shadow.setZ(3)}else{this.$.shadow.setZ(1)}},downAction:function(e){this._downAction();if(this.hasAttribute("noink")){return}this.lastEvent=e;if(!this.$.ripple){var ripple=document.createElement("paper-ripple");ripple.setAttribute("id","ripple");ripple.setAttribute("fit","");if(this.recenteringTouch){ripple.classList.add("recenteringTouch")}if(!this.fill){ripple.classList.add("circle")}this.$.ripple=ripple;this.shadowRoot.insertBefore(ripple,this.shadowRoot.firstChild)}},upAction:function(){this._upAction();if(this.toggle){this.toggleBackground();if(this.$.ripple){this.$.ripple.cancel()}}}};Polymer.mixin2(p,Polymer.CoreFocusable);Polymer(p)})();</script></polymer-element><polymer-element name="paper-button" extends="paper-button-base" attributes="raised recenteringTouch fill" role="button" assetpath="polymer/bower_components/paper-button/"><template><style>:host{display:inline-block;position:relative;box-sizing:border-box;min-width:5.14em;margin:0 .29em;background:0 0;text-align:center;font:inherit;text-transform:uppercase;outline:0;border-radius:3px;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;cursor:pointer;z-index:0}:host([disabled]){background:#eaeaea;color:#a8a8a8;cursor:auto;pointer-events:none}::content *{text-transform:inherit}#bg,#shadow{border-radius:inherit}#ripple{pointer-events:none;z-index:-1}.button-content{padding:.7em .57em}polyfill-next-selector{content:'.button-content > a'}::content>a{height:100%;padding:.7em .57em;margin:-.7em -.57em;-ms-flex:1 1 0;-webkit-flex:1;flex:1;-webkit-flex-basis:0;flex-basis:0}</style><template if="{{raised}}"><paper-shadow id="shadow" fit="" animated=""></paper-shadow></template><div class="button-content" relative="" layout="" horizontal="" center-center=""><content></content></div><core-a11y-keys keys="space enter" target="{{}}" on-keys-pressed="{{_activate}}"></core-a11y-keys></template><script>Polymer("paper-button",{publish:{raised:false,recenteringTouch:false,fill:true},_activate:function(){this.click();this.fire("tap");if(!this.pressed){var bcr=this.getBoundingClientRect();var x=bcr.left+bcr.width/2;var y=bcr.top+bcr.height/2;this.downAction({x:x,y:y});var fn=function fn(){this.upAction();this.removeEventListener("keyup",fn)}.bind(this);this.addEventListener("keyup",fn)}}});</script></polymer-element><polymer-element name="paper-spinner" attributes="active alt" role="progressbar" assetpath="polymer/bower_components/paper-spinner/"><template><style>:host{display:inline-block;position:relative;width:28px;height:28px}#spinnerContainer{width:100%;height:100%}#spinnerContainer.active{-webkit-animation:container-rotate 1568ms linear infinite;animation:container-rotate 1568ms linear infinite}@-webkit-keyframes container-rotate{to{-webkit-transform:rotate(360deg)}}@keyframes container-rotate{to{transform:rotate(360deg)}}.spinner-layer{position:absolute;width:100%;height:100%;opacity:0}.blue{border-color:#4285f4}.red{border-color:#db4437}.yellow{border-color:#f4b400}.green{border-color:#0f9d58}.active .spinner-layer.blue{-webkit-animation:fill-unfill-rotate 5332ms cubic-bezier(0.4,0,.2,1) infinite both,blue-fade-in-out 5332ms cubic-bezier(0.4,0,.2,1) infinite both;animationLine truncated
{{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>Polymer("more-info-configurator",{action:"display",submitClicked:function(){this.action="configuring";var data={configure_id:this.stateObj.attributes.configure_id};window.hass.serviceActions.callService("configurator","configure",data).then(function(){this.action="display";window.hass.syncActions.sync()}.bind(this),function(){this.action="display"}.bind(this))}});</script></polymer-element><polymer-element name="more-info-content" attributes="stateObj" assetpath="polymer/more-infos/"><template><style>:host{display:block}</style><div id="moreInfoContainer" class="{{classNames}}"></div></template><script>Polymer("more-info-content",{classNames:"",observe:{"stateObj.attributes":"stateAttributesChanged"},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;moreInfoContainer.appendChild(moreInfo)}else{moreInfoContainer.lastChild.stateObj=newVal}},stateAttributesChanged:function(oldVal,newVal){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-action-dialog id="dialog"><style>.title-card{margin-bottom:24px}</style><div><state-card-content stateobj="{{stateObj}}" class="title-card"></state-card-content><state-timeline statehistory="{{stateHistory}}"></state-timeline><more-info-content stateobj="{{stateObj}}"></more-info-content></div></ha-action-dialog></template><script>Polymer("more-info-dialog",{stateObj:{},stateHistory:null,observe:{"stateObj.attributes":"reposition"},ready:function(){this.stateHistoryStoreChanged=this.stateHistoryStoreChanged.bind(this);window.hass.stateHistoryStore.addChangeListener(this.stateHistoryStoreChanged)},detached:function(){window.hass.stateHistoryStore.removeChangeListener(this.stateHistoryStoreChanged)},stateHistoryStoreChanged:function(){if(this.stateObj.entityId){this.stateHistory=window.hass.stateHistoryStore.get(this.stateObj.entityId)}else{this.stateHistory=null}},stateObjChanged:function(){if(this.stateObj.entityId&&window.hass.stateHistoryStore.isStale(this.stateObj.entityId)){window.hass.stateHistoryActions.fetch(this.stateObj.entityId)}this.stateHistoryStoreChanged()},reposition:function(oldVal,newVal){if(this.$.dialog.opened){this.job("resizeAfterLayoutChange",function(){this.$.dialog.resizeHandler()}.bind(this),1e3)}},show:function(stateObj){this.stateObj=stateObj;this.job("showDialogAfterRender",function(){this.$.dialog.toggle()}.bind(this))}});</script></polymer-element><script>!function(t){function n(r){if(e[r])return e[r].exports;var i=e[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";var r=e(2);window.hass||(window.hass={callApi:e(4),actions:e(1),dispatcher:r,authActions:e(20),componentActions:e(6),eventActions:e(9),serviceActions:e(10),stateActions:e(7),syncActions:e(11),stateHistoryActions:e(21),authStore:e(13),componentStore:e(22),eventStore:e(23),serviceStore:e(14),stateStore:e(24),syncStore:e(26),stateHistoryStore:e(25),stateModel:e(12)})},function(t,n,e){"use strict";var r=e(3),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_SHOW_TOAST","ACTION_EVENT_FIRED","ACTION_INITIAL_LOAD_DONE"];t.exports=r.zipObject(i,i)},function(t,n,e){"use strict";var r=e(15).Dispatcher;t.exports=new r},function(t,n,e){var r;(function(t,i){(function(){function u(t,n){if(t!==n){var e=t===t,r=n===n;if(t>n||!e||"undefined"==typeof t&&r)return 1;if(n>t||!r||"undefined"==typeof n&&e)return-1}return 0}function o(t,n,e){if(n!==n)return _(t,e);for(var r=(e||0)-1,i=t.length;++r<i;)if(t[r]===n)return r;return-1}function a(t,n){var e=t.length;for(t.sort(n);e--;)t[e]=t[e].value;return t}function s(t){return"string"==typeof t?t:null==t?"":t+""}function c(t){return t.charCodeAt(0)}function f(t,n){for(var e=-1,r=t.length;++e<r&&n.indexOf(t.charAt(e))>-1;);return e}function l(t,n){for(var e=t.length;e--&&n.indexOf(t.charAt(e))>-1;);return e}function h(t,n){return u(t.criteria,n.criteria)||t.index-n.index}function p(t,n){for(var e=-1,r=t.criteria,i=n.criteria,o=r.length;++e<o;){var a=u(r[e],i[e]);if(a)return a}return t.index-n.index}function v(t){return Mn[t]}function g(t){returLine truncated
}function io(t,n,e){t=s(t),n=+n;var r=t.length;if(r>=n||!pa(n))return t;var i=(n-r)/2,u=na(i),o=Qo(i);return e=ar("",o,e),e.slice(0,u)+t+e}function uo(t,n,e){return t=s(t),t&&ar(t,n,e)+t}function oo(t,n,e){return t=s(t),t&&t+ar(t,n,e)}function ao(t,n,e){return e&&wr(t,n,e)&&(n=0),ma(t,n)}function so(t,n){var e="";if(t=s(t),n=+n,1>n||!t||!pa(n))return e;do n%2&&(e+=t),n=na(n/2),t+=t;while(n);return e}function co(t,n,e){return t=s(t),e=null==e?0:da(0>e?0:+e||0,t.length),t.lastIndexOf(n,e)==e}function fo(t,e,r){var i=n.templateSettings;r&&wr(t,e,r)&&(e=r=null),t=s(t),e=le(le({},r||e),i,fe);var u,o,a=le(le({},e.imports),i.imports,fe),c=Ba(a),f=Be(a,c),l=0,h=e.interpolate||Sn,p="__p += '",v=Uo((e.escape||Sn).source+"|"+h.source+"|"+(h===En?Nn:Sn).source+"|"+(e.evaluate||Sn).source+"|$","g"),g="//# sourceURL="+("sourceURL"in e?e.sourceURL:"lodash.templateSources["+ ++Hn+"]")+"\n";t.replace(v,function(n,e,r,i,a,s){return r||(r=i),p+=t.slice(l,s).replace($n,d),e&&(u=!0,p+="' +\n__e("+e+") +\n'"),a&&(o=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=s+n.length,n}),p+="';\n";var _=e.variable;_||(p="with (obj) {\n"+p+"\n}\n"),p=(o?p.replace(dn,""):p).replace(_n,"$1").replace(yn,"$1;"),p="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var y=yo(function(){return jo(c,g+"return "+p).apply(N,f)});if(y.source=p,yu(y))throw y;return y}function lo(t,n,e){var r=t;return(t=s(t))?(e?wr(r,n,e):null==n)?t.slice(w(t),b(t)+1):(n+="",t.slice(f(t,n),l(t,n)+1)):t}function ho(t,n,e){var r=t;return t=s(t),t?t.slice((e?wr(r,n,e):null==n)?w(t):f(t,n+"")):t}function po(t,n,e){var r=t;return t=s(t),t?(e?wr(r,n,e):null==n)?t.slice(0,b(t)+1):t.slice(0,l(t,n+"")+1):t}function vo(t,n,e){e&&wr(t,n,e)&&(n=null);var r=W,i=U;if(null!=n)if(Tu(n)){var u="separator"in n?n.separator:u;r="length"in n?+n.length||0:r,i="omission"in n?s(n.omission):i}else r=+n||0;if(t=s(t),r>=t.length)return t;var o=r-i.length;if(1>o)return i;var a=t.slice(0,o);if(null==u)return a+i;if(Nu(u)){if(t.slice(o).search(u)){var c,f,l=t.slice(0,o);for(u.global||(u=Uo(u.source,(Cn.exec(u)||"")+"g")),u.lastIndex=0;c=u.exec(l);)f=c.index;a=a.slice(0,null==f?o:f)}}else if(t.indexOf(u,o)!=o){var h=a.lastIndexOf(u);h>-1&&(a=a.slice(0,h))}return a+i}function go(t){return t=s(t),t&&An.test(t)?t.replace(mn,O):t}function _o(t,n,e){return e&&wr(t,n,e)&&(n=null),t=s(t),t.match(n||Wn)||[]}function yo(t){try{return t()}catch(n){return yu(n)?n:ko(n)}}function mo(t,n,e){return e&&wr(t,n,e)&&(n=null),y(t)?wo(t):ge(t,n)}function To(t){return function(){return t}}function Ao(t){return t}function wo(t){return $e(de(t,!0))}function bo(t,n,e){if(null==e){var r=Tu(n),i=r&&Ba(n),u=i&&i.length&&De(n,i);(u?u.length:r)||(u=!1,e=n,n=t,t=this)}u||(u=De(n,Ba(n)));var o=!0,a=-1,s=mu(t),c=u.length;e===!1?o=!1:Tu(e)&&"chain"in e&&(o=e.chain);for(;++a<c;){var f=u[a],l=n[f];t[f]=l,s&&(t.prototype[f]=function(n){return function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__);return(r.__actions__=Xn(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}var i=[this.value()];return ra.apply(i,arguments),n.apply(t,i)}}(l))}return t}function Oo(){return t._=Yo,this}function Eo(){}function No(t){return Fe(t+"")}function Co(t){return function(n){return null==t?N:t[n]}}function Io(t,n,e){e&&wr(t,n,e)&&(n=e=null),t=+t||0,e=null==e?1:+e||0,null==n?(n=t,t=0):n=+n||0;for(var r=-1,i=ga(Qo((n-t)/(e||1)),0),u=Lo(i);++r<i;)u[r]=t,t+=e;return u}function xo(t,n,e){if(t=+t,1>t||!pa(t))return[];var r=-1,i=Lo(da(t,ba));for(n=Je(n,e,1);++r<t;)ba>r?i[r]=n(r):n(r);return i}function Do(t){var n=++zo;return s(t)+n}t=t?Qn.defaults(Yn.Object(),t,Qn.pick(Yn,Fn)):Yn;var Lo=t.Array,So=t.Date,ko=t.Error,jo=t.Function,Ro=t.Math,$o=t.Number,Wo=t.Object,Uo=t.RegExp,Fo=t.String,Ho=t.TypeError,Po=Lo.prototype,Vo=Wo.prototype,Go=(Go=t.window)&&Go.document,Mo=jo.prototype.toString,Ko=Fe("length"),Bo=Vo.hasOwnProperty,zo=0,qo=Vo.toString,Yo=t._,Jo=Uo("^"+ro(qo).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xo=bu(Xo=t.ArrayBuffer)&&Xo,Zo=bu(Zo=Xo&&new Xo(0).slice)&&Zo,Qo=Ro.ceil,ta=t.clearTimeout,na=Ro.floor,ea=bu(ea=Wo.getPrototypeOf)&&ea,ra=Po.push,ia=Vo.propertyIsEnumerable,ua=bu(ua=t.Set)&&ua,oa=t.setTimeout,aa=Po.splice,sa=bu(sa=t.Uint8Array)&&sa,ca=(Po.unshift,bu(ca=t.WeakMap)&&ca),fa=function(){try{var n=bu(n=t.Float64Array)&&n,e=new n(new Xo(10),0,1)&&n}catch(r){}return e}(),la=bu(la=Lo.isArray)&&la,ha=bu(ha=Wo.create)&&ha,pa=t.isFinite,va=bu(va=Wo.keys)&&va,ga=Ro.max,da=Ro.min,_a=bu(_a=So.now)&&_a,ya=bu(ya=$o.isFinite)&&ya,ma=t.parseInt,Ta=Ro.random,Aa=$o.NEGATIVE_INFINITY,wa=$o.POSITIVE_INFINITY,ba=Ro.pow(2,32)-1,Oa=ba-1,Ea=ba>>>1,Na=fa?fa.BYTES_PER_ELEMENT:0,Ca=Ro.pow(2,53)-1,Ia=ca&&new ca,xa=n.support={};!function(){xa.funcDecomp=!bu(t.WinRTError)&&Rn.test(E),xa.funcNames="stLine 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
</paper-button><span hidden?="{{action !== 'configuring'}}"><paper-spinner active="true"></paper-spinner><span>Configuring…</span></span></p></template></div></template><script>Polymer("more-info-configurator",{action:"display",submitClicked:function(){this.action="configuring";var data={configure_id:this.stateObj.attributes.configure_id};window.hass.serviceActions.callService("configurator","configure",data).then(function(){this.action="display";window.hass.syncActions.sync()}.bind(this),function(){this.action="display"}.bind(this))}});</script></polymer-element><polymer-element name="more-info-content" attributes="stateObj" assetpath="polymer/more-infos/"><template><style>:host{display:block}</style><div id="moreInfoContainer" class="{{classNames}}"></div></template><script>Polymer("more-info-content",{classNames:"",observe:{"stateObj.attributes":"stateAttributesChanged"},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;moreInfoContainer.appendChild(moreInfo)}else{moreInfoContainer.lastChild.stateObj=newVal}},stateAttributesChanged:function(oldVal,newVal){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-action-dialog id="dialog"><style>.title-card{margin-bottom:24px}</style><div><state-card-content stateobj="{{stateObj}}" class="title-card"></state-card-content><state-timeline statehistory="{{stateHistory}}"></state-timeline><more-info-content stateobj="{{stateObj}}"></more-info-content></div></ha-action-dialog></template><script>Polymer("more-info-dialog",{stateObj:{},stateHistory:null,observe:{"stateObj.attributes":"reposition"},ready:function(){this.stateHistoryStoreChanged=this.stateHistoryStoreChanged.bind(this);window.hass.stateHistoryStore.addChangeListener(this.stateHistoryStoreChanged)},detached:function(){window.hass.stateHistoryStore.removeChangeListener(this.stateHistoryStoreChanged)},stateHistoryStoreChanged:function(){if(this.stateObj.entityId){this.stateHistory=window.hass.stateHistoryStore.get(this.stateObj.entityId)}else{this.stateHistory=null}},stateObjChanged:function(){if(this.stateObj.entityId&&window.hass.stateHistoryStore.isStale(this.stateObj.entityId)){window.hass.stateHistoryActions.fetch(this.stateObj.entityId)}this.stateHistoryStoreChanged()},reposition:function(oldVal,newVal){if(this.$.dialog.opened){this.job("resizeAfterLayoutChange",function(){this.$.dialog.resizeHandler()}.bind(this),1e3)}},show:function(stateObj){this.stateObj=stateObj;this.job("showDialogAfterRender",function(){this.$.dialog.toggle()}.bind(this))}});</script></polymer-element><script>!function(t){function n(r){if(e[r])return e[r].exports;var i=e[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";var r=e(2);window.hass||(window.hass={callApi:e(4),actions:e(1),dispatcher:r,authActions:e(21),componentActions:e(6),eventActions:e(10),serviceActions:e(11),stateActions:e(7),syncActions:e(12),stateHistoryActions:e(22),authStore:e(13),componentStore:e(23),eventStore:e(24),serviceStore:e(14),stateStore:e(25),syncStore:e(27),stateHistoryStore:e(26),stateModel:e(9),util:e(15)})},function(t,n,e){"use strict";var r=e(3),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_SHOW_TOAST","ACTION_EVENT_FIRED","ACTION_INITIAL_LOAD_DONE"];t.exports=r.zipObject(i,i)},function(t,n,e){"use strict";var r=e(16).Dispatcher;t.exports=new r},function(t,n,e){var r;(function(t,i){(function(){function u(t,n){if(t!==n){var e=t===t,r=n===n;if(t>n||!e||"undefined"==typeof t&&r)return 1;if(n>t||!r||"undefined"==typeof n&&e)return-1}return 0}function o(t,n,e){if(n!==n)return _(t,e);for(var r=(e||0)-1,i=t.length;++r<i;)if(t[r]===n)return r;return-1}function a(t,n){var e=t.length;for(t.sort(n);e--;)t[e]=t[e].value;return t}function s(t){return"string"==typeof t?t:null==t?"":t+""}function c(t){return t.charCodeAt(0)}function f(t,n){for(var e=-1,r=t.length;++e<r&&n.indexOf(t.charAt(e))>-1;);return e}function l(t,n){for(var e=t.length;e--&&n.indexOf(t.charAt(e))>-1;);return e}function h(t,n){return u(t.criteria,n.criteria)||t.index-n.index}function p(t,n){for(var e=-1,r=t.criteria,i=n.criteria,o=r.length;++e<o;){var a=u(r[e],i[e]);if(a)return a}return t.index-n.index}function v(t){return Mn[t]}functionLine truncated
}function ro(t){return t=s(t),t&&jn.test(t)?t.replace(kn,"\\$&"):t}function io(t,n,e){t=s(t),n=+n;var r=t.length;if(r>=n||!pa(n))return t;var i=(n-r)/2,u=na(i),o=Qo(i);return e=ar("",o,e),e.slice(0,u)+t+e}function uo(t,n,e){return t=s(t),t&&ar(t,n,e)+t}function oo(t,n,e){return t=s(t),t&&t+ar(t,n,e)}function ao(t,n,e){return e&&wr(t,n,e)&&(n=0),ma(t,n)}function so(t,n){var e="";if(t=s(t),n=+n,1>n||!t||!pa(n))return e;do n%2&&(e+=t),n=na(n/2),t+=t;while(n);return e}function co(t,n,e){return t=s(t),e=null==e?0:da(0>e?0:+e||0,t.length),t.lastIndexOf(n,e)==e}function fo(t,e,r){var i=n.templateSettings;r&&wr(t,e,r)&&(e=r=null),t=s(t),e=le(le({},r||e),i,fe);var u,o,a=le(le({},e.imports),i.imports,fe),c=Ba(a),f=Be(a,c),l=0,h=e.interpolate||Ln,p="__p += '",v=Wo((e.escape||Ln).source+"|"+h.source+"|"+(h===En?In:Ln).source+"|"+(e.evaluate||Ln).source+"|$","g"),g="//# sourceURL="+("sourceURL"in e?e.sourceURL:"lodash.templateSources["+ ++Hn+"]")+"\n";t.replace(v,function(n,e,r,i,a,s){return r||(r=i),p+=t.slice(l,s).replace($n,d),e&&(u=!0,p+="' +\n__e("+e+") +\n'"),a&&(o=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=s+n.length,n}),p+="';\n";var _=e.variable;_||(p="with (obj) {\n"+p+"\n}\n"),p=(o?p.replace(dn,""):p).replace(_n,"$1").replace(yn,"$1;"),p="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var y=yo(function(){return jo(c,g+"return "+p).apply(I,f)});if(y.source=p,yu(y))throw y;return y}function lo(t,n,e){var r=t;return(t=s(t))?(e?wr(r,n,e):null==n)?t.slice(w(t),b(t)+1):(n+="",t.slice(f(t,n),l(t,n)+1)):t}function ho(t,n,e){var r=t;return t=s(t),t?t.slice((e?wr(r,n,e):null==n)?w(t):f(t,n+"")):t}function po(t,n,e){var r=t;return t=s(t),t?(e?wr(r,n,e):null==n)?t.slice(0,b(t)+1):t.slice(0,l(t,n+"")+1):t}function vo(t,n,e){e&&wr(t,n,e)&&(n=null);var r=U,i=W;if(null!=n)if(Tu(n)){var u="separator"in n?n.separator:u;r="length"in n?+n.length||0:r,i="omission"in n?s(n.omission):i}else r=+n||0;if(t=s(t),r>=t.length)return t;var o=r-i.length;if(1>o)return i;var a=t.slice(0,o);if(null==u)return a+i;if(Iu(u)){if(t.slice(o).search(u)){var c,f,l=t.slice(0,o);for(u.global||(u=Wo(u.source,(Nn.exec(u)||"")+"g")),u.lastIndex=0;c=u.exec(l);)f=c.index;a=a.slice(0,null==f?o:f)}}else if(t.indexOf(u,o)!=o){var h=a.lastIndexOf(u);h>-1&&(a=a.slice(0,h))}return a+i}function go(t){return t=s(t),t&&An.test(t)?t.replace(mn,O):t}function _o(t,n,e){return e&&wr(t,n,e)&&(n=null),t=s(t),t.match(n||Un)||[]}function yo(t){try{return t()}catch(n){return yu(n)?n:ko(n)}}function mo(t,n,e){return e&&wr(t,n,e)&&(n=null),y(t)?wo(t):ge(t,n)}function To(t){return function(){return t}}function Ao(t){return t}function wo(t){return $e(de(t,!0))}function bo(t,n,e){if(null==e){var r=Tu(n),i=r&&Ba(n),u=i&&i.length&&De(n,i);(u?u.length:r)||(u=!1,e=n,n=t,t=this)}u||(u=De(n,Ba(n)));var o=!0,a=-1,s=mu(t),c=u.length;e===!1?o=!1:Tu(e)&&"chain"in e&&(o=e.chain);for(;++a<c;){var f=u[a],l=n[f];t[f]=l,s&&(t.prototype[f]=function(n){return function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__);return(r.__actions__=Xn(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}var i=[this.value()];return ra.apply(i,arguments),n.apply(t,i)}}(l))}return t}function Oo(){return t._=Jo,this}function Eo(){}function Io(t){return Fe(t+"")}function No(t){return function(n){return null==t?I:t[n]}}function Co(t,n,e){e&&wr(t,n,e)&&(n=e=null),t=+t||0,e=null==e?1:+e||0,null==n?(n=t,t=0):n=+n||0;for(var r=-1,i=ga(Qo((n-t)/(e||1)),0),u=So(i);++r<i;)u[r]=t,t+=e;return u}function xo(t,n,e){if(t=+t,1>t||!pa(t))return[];var r=-1,i=So(da(t,ba));for(n=Ye(n,e,1);++r<t;)ba>r?i[r]=n(r):n(r);return i}function Do(t){var n=++zo;return s(t)+n}t=t?Qn.defaults(Jn.Object(),t,Qn.pick(Jn,Fn)):Jn;var So=t.Array,Lo=t.Date,ko=t.Error,jo=t.Function,Ro=t.Math,$o=t.Number,Uo=t.Object,Wo=t.RegExp,Fo=t.String,Ho=t.TypeError,Po=So.prototype,Vo=Uo.prototype,Go=(Go=t.window)&&Go.document,Mo=jo.prototype.toString,Ko=Fe("length"),Bo=Vo.hasOwnProperty,zo=0,qo=Vo.toString,Jo=t._,Yo=Wo("^"+ro(qo).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xo=bu(Xo=t.ArrayBuffer)&&Xo,Zo=bu(Zo=Xo&&new Xo(0).slice)&&Zo,Qo=Ro.ceil,ta=t.clearTimeout,na=Ro.floor,ea=bu(ea=Uo.getPrototypeOf)&&ea,ra=Po.push,ia=Vo.propertyIsEnumerable,ua=bu(ua=t.Set)&&ua,oa=t.setTimeout,aa=Po.splice,sa=bu(sa=t.Uint8Array)&&sa,ca=(Po.unshift,bu(ca=t.WeakMap)&&ca),fa=function(){try{var n=bu(n=t.Float64Array)&&n,e=new n(new Xo(10),0,1)&&n}catch(r){}return e}(),la=bu(la=So.isArray)&&la,ha=bu(ha=Uo.create)&&ha,pa=t.isFinite,va=bu(va=Uo.keys)&&va,ga=Ro.max,da=Ro.min,_a=bu(_a=Lo.now)&&_a,ya=bu(ya=$o.isFinite)&&ya,ma=t.parseInt,Ta=Ro.random,Aa=$o.NEGATIVE_INFINITY,wa=$o.POSITIVE_INFINITY,ba=Ro.pow(2,32)-1,Oa=ba-1,Ea=ba>>>1,Ia=fa?fa.BYTES_PER_ELEMENT:0,Na=Ro.pow(2,53)-1,Ca=ca&&new ca,xa=n.support={};!functLine 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
<div hidden><polymer-element name="login-form" assetpath="polymer/layouts/"><template><style>paper-input{display:block}.login paper-button{margin-left:242px}.login .interact{height:125px}#validatebox{text-align:center}.validatemessage{margin-top:10px}</style><div layout="" horizontal="" center="" fit="" class="login" id="splash"><div layout="" vertical="" center="" flex=""><img src="/static/favicon-192x192.png"><h1>Home Assistant</h1><a href="polymer/layouts/#" id="hideKeyboardOnFocus"></a><div class="interact" layout="" vertical=""><div id="loginform" hidden?="{{isValidating || isLoggedIn}}"><paper-input-decorator label="Password" id="passwordDecorator"><input is="core-input" type="password" id="passwordInput" value="{{authToken}}" on-keyup="{{passwordKeyup}}"></paper-input-decorator><paper-button on-click="{{validatePassword}}">Log In</paper-button></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>Polymer("login-form",{MSG_VALIDATING:"Validating password…",MSG_LOADING_DATA:"Loading data…",authToken:"",isValidating:false,isLoggedIn:false,spinnerMessage:"",ready:function(){this.authStore=window.hass.authStore;this.authChangeListener=this.authChangeListener.bind(this);this.authStore.addChangeListener(this.authChangeListener);this.authChangeListener()},attached:function(){this.focusPassword()},detached:function(){this.authStore.removeChangeListener(this.authChangeListener)},authChangeListener:function(){this.isValidating=this.authStore.isValidating();this.isLoggedIn=this.authStore.isLoggedIn();this.spinnerMessage=this.isValidating?this.MSG_VALIDATING:this.MSG_LOADING_DATA;if(this.authStore.wasLastAttemptInvalid()){this.$.passwordDecorator.error=this.authStore.getLastAttemptMessage();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();window.hass.authActions.validate(this.authToken)}});</script></polymer-element></div>
<div hidden><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.$.selection.isSelected(item)){this.$.selection.setItemSelected(item,isSelected)}},updateSelectedItem:function(){this.selectedItem=this.selection},selectedItemChanged:function(){if(this.selectedItem){var t=this.selectedItem.templateInstance;this.selectedModel=t?t.model:undefined}else{this.selectedModel=null}this.selectedIndex=this.selectedItem?parseInt(this.valueToIndex(this.selected)):-1},valueToItem:function(value){return value===null||value===undefined?null:this.items[this.valueToIndex(value)]},valueToIndex:function(value){for(var i=0,items=this.items,c;c=items[i];i++){if(this.valueForNode(c)==value){return i}}return value},valueForNode:function(node){return node[this.valueattr]||node.getALine truncated
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.
@@ -47,43 +47,45 @@
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
var stateTimeToDate = function(time) {
if (!time) return new Date();
return window.hass.util.parseTime(time).toDate();
var addRow = function(entityDisplay, stateStr, start, end) {
dataTable.addRow([entityDisplay, stateStr, start, end]);
};
var addRow = function(baseState, state, tillState) {
tillState = tillState || {};
dataTable.addRow([
baseState.entityDisplay, state.state,
stateTimeToDate(state.last_changed),
stateTimeToDate(tillState.last_changed)]);
};
if (this.stateHistory.length === 0) {
return;
}
// people can pass in history of 1 entityId or a collection.
var stateHistory = _.isArray(this.stateHistory[0]) ?
this.stateHistory : [this.stateHistory];
var stateHistory;
if (_.isArray(this.stateHistory[0])) {
stateHistory = this.stateHistory;
} else {
stateHistory = [this.stateHistory];
}
// stateHistory is a list of lists of sorted state objects
stateHistory.forEach(function(stateInfo) {
if(stateInfo.length === 0) return;
var baseState = new window.hass.stateModel(stateInfo[0]);
var prevRow = null;
var entityDisplay = stateInfo[0].entityDisplay;
var newLastChanged, prevState = null, prevLastChanged = null;
stateInfo.forEach(function(state) {
if (prevRow !== null && state.state !== prevRow.state) {
addRow(baseState, prevRow, state);
prevRow = state;
} else if (prevRow === null) {
prevRow = state;
if (prevState !== null && state.state !== prevState) {
newLastChanged = state.lastChangedAsDate;
addRow(entityDisplay, prevState, prevLastChanged, newLastChanged);
prevState = state.state;
prevLastChanged = newLastChanged;
} else if (prevState === null) {
prevState = state.state;
prevLastChanged = state.lastChangedAsDate;
}
});
addRow(baseState, prevRow, null);
addRow(entityDisplay, prevState, prevLastChanged, new Date());
}.bind(this));
chart.draw(dataTable, {
@@ -11,8 +11,11 @@
// Register some polymer filters
PolymerExpressions.prototype.relativeHATime = function(timeString) {
return window.hass.util.relativeTime(timeString);
if (!timeString) return;
return moment(window.hass.util.parseDateTime(timeString)).fromNow();
};
PolymerExpressions.prototype.HATimeStripDate = function(timeString) {
return (timeString || "").split(' ')[0];
};
@@ -31,8 +31,8 @@
Polymer({
stateObjChanged: function() {
var rising = window.hass.util.parseTime(this.stateObj.attributes.next_rising);
var setting = window.hass.util.parseTime(this.stateObj.attributes.next_setting);
var rising = window.hass.util.parseDateTime(this.stateObj.attributes.next_rising);
var setting = window.hass.util.parseDateTime(this.stateObj.attributes.next_setting);
if(rising > setting) {
this.$.sunData.appendChild(this.$.rising);