Move frontend specific js to webcomponents
This commit is contained in:
1 parent
2cfcbf6380
commit
33daf0a385
6 files changed
+48
-9
No files matched your search
@@ -1,2 +1,2 @@
|
||||
""" DO NOT MODIFY. Auto-generated by build_frontend script """
|
||||
VERSION = "b08c8203bd0a78ae1b1b2eec9f62f8b4"
|
||||
VERSION = "be9fb38e992137e8e3b83e4ff91f9c7c"
|
||||
@@ -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 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
|
||||
{{key}}
|
||||
</div><div class="value">
|
||||
{{stateObj.attributes[key]}}
|
||||
@@ -178,10 +178,9 @@ b.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.loc
|
||||
{{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(22),componentActions:e(6),eventActions:e(10),serviceActions:e(11),stateActions:e(7),syncActions:e(12),stateHistoryActions:e(23),authStore:e(14),componentStore:e(24),eventStore:e(25),serviceStore:e(15),stateStore:e(26),syncStore:e(28),stateHistoryStore:e(27),stateModel:e(13),util:e(16)})},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(17).Dispatcher;t.exports=new r},function(t,n,e){var r;(function(t,i){(function(){function a(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 g(t,e);for(var r=(e||0)-1,i=t.length;++r<i;)if(t[r]===n)return r;return-1}function s(t,n){var e=t.length;for(t.sort(n);e--;)t[e]=t[e].value;return t}function u(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 a(t.criteria,n.criteria)||t.index-n.index}function d(t,n){for(var e=-1,r=t.criteria,i=n.criteria,o=r.length;++e<o;){var s=a(r[e],i[e]);if(s)return s}return t.index-n.index}function p(t){return $n[t]}functioLine truncated
|
||||
}function ro(t){return t=u(t),t&&Nn.test(t)?t.replace(xn,"\\$&"):t}function io(t,n,e){t=u(t),n=+n;var r=t.length;if(r>=n||!ds(n))return t;var i=(n-r)/2,a=ns(i),o=Qo(i);return e=sr("",o,e),e.slice(0,a)+t+e}function ao(t,n,e){return t=u(t),t&&sr(t,n,e)+t}function oo(t,n,e){return t=u(t),t&&t+sr(t,n,e)}function so(t,n,e){return e&&Dr(t,n,e)&&(n=0),ys(t,n)}function uo(t,n){var e="";if(t=u(t),n=+n,1>n||!t||!ds(n))return e;do n%2&&(e+=t),n=ns(n/2),t+=t;while(n);return e}function co(t,n,e){return t=u(t),e=null==e?0:vs(0>e?0:+e||0,t.length),t.lastIndexOf(n,e)==e}function fo(t,e,r){var i=n.templateSettings;r&&Dr(t,e,r)&&(e=r=null),t=u(t),e=le(le({},r||e),i,fe);var a,o,s=le(le({},e.imports),i.imports,fe),c=zs(s),f=ze(s,c),l=0,h=e.interpolate||In,d="__p += '",p=Fo((e.escape||In).source+"|"+h.source+"|"+(h===kn?Mn:In).source+"|"+(e.evaluate||In).source+"|$","g"),_="//# sourceURL="+("sourceURL"in e?e.sourceURL:"lodash.templateSources["+ ++jn+"]")+"\n";t.replace(p,function(n,e,r,i,s,u){return r||(r=i),d+=t.slice(l,u).replace(Un,v),e&&(a=!0,d+="' +\n__e("+e+") +\n'"),s&&(o=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+n.length,n}),d+="';\n";var g=e.variable;g||(d="with (obj) {\n"+d+"\n}\n"),d=(o?d.replace(vn,""):d).replace(gn,"$1").replace(mn,"$1;"),d="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=mo(function(){return No(c,_+"return "+d).apply(M,f)});if(m.source=d,ma(m))throw m;return m}function lo(t,n,e){var r=t;return(t=u(t))?(e?Dr(r,n,e):null==n)?t.slice(D(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=u(t),t?t.slice((e?Dr(r,n,e):null==n)?D(t):f(t,n+"")):t}function po(t,n,e){var r=t;return t=u(t),t?(e?Dr(r,n,e):null==n)?t.slice(0,b(t)+1):t.slice(0,l(t,n+"")+1):t}function _o(t,n,e){e&&Dr(t,n,e)&&(n=null);var r=W,i=F;if(null!=n)if(wa(n)){var a="separator"in n?n.separator:a;r="length"in n?+n.length||0:r,i="omission"in n?u(n.omission):i}else r=+n||0;if(t=u(t),r>=t.length)return t;var o=r-i.length;if(1>o)return i;var s=t.slice(0,o);if(null==a)return s+i;if(Ma(a)){if(t.slice(o).search(a)){var c,f,l=t.slice(0,o);for(a.global||(a=Fo(a.source,(An.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(l);)f=c.index;s=s.slice(0,null==f?o:f)}}else if(t.indexOf(a,o)!=o){var h=s.lastIndexOf(a);h>-1&&(s=s.slice(0,h))}return s+i}function vo(t){return t=u(t),t&&Tn.test(t)?t.replace(yn,O):t}function go(t,n,e){return e&&Dr(t,n,e)&&(n=null),t=u(t),t.match(n||Wn)||[]}function mo(t){try{return t()}catch(n){return ma(n)?n:xo(n)}}function yo(t,n,e){return e&&Dr(t,n,e)&&(n=null),m(t)?Do(t):_e(t,n)}function wo(t){return function(){return t}}function To(t){return t}function Do(t){return Ue(ve(t,!0))}function bo(t,n,e){if(null==e){var r=wa(n),i=r&&zs(n),a=i&&i.length&&Ee(n,i);(a?a.length:r)||(a=!1,e=n,n=t,t=this)}a||(a=Ee(n,zs(n)));var o=!0,s=-1,u=ya(t),c=a.length;e===!1?o=!1:wa(e)&&"chain"in e&&(o=e.chain);for(;++s<c;){var f=a[s],l=n[f];t[f]=l,u&&(t.prototype[f]=function(n){return function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__);return(r.__actions__=Jn(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}var i=[this.value()];return rs.apply(i,arguments),n.apply(t,i)}}(l))}return t}function Oo(){return t._=Bo,this}function ko(){}function Mo(t){return Ge(t+"")}function Ao(t){return function(n){return null==t?M:t[n]}}function So(t,n,e){e&&Dr(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=_s(Qo((n-t)/(e||1)),0),a=Yo(i);++r<i;)a[r]=t,t+=e;return a}function Co(t,n,e){if(t=+t,1>t||!ds(t))return[];var r=-1,i=Yo(vs(t,bs));for(n=Ke(n,e,1);++r<t;)bs>r?i[r]=n(r):n(r);return i}function Eo(t){var n=++Zo;return u(t)+n}t=t?Qn.defaults(Bn.Object(),t,Qn.pick(Bn,Gn)):Bn;var Yo=t.Array,Io=t.Date,xo=t.Error,No=t.Function,Lo=t.Math,Uo=t.Number,Wo=t.Object,Fo=t.RegExp,Go=t.String,jo=t.TypeError,Po=Yo.prototype,Ho=Wo.prototype,Ro=(Ro=t.window)&&Ro.document,$o=No.prototype.toString,Vo=Ge("length"),zo=Ho.hasOwnProperty,Zo=0,qo=Ho.toString,Bo=t._,Ko=Fo("^"+ro(qo).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Jo=ba(Jo=t.ArrayBuffer)&&Jo,Xo=ba(Xo=Jo&&new Jo(0).slice)&&Xo,Qo=Lo.ceil,ts=t.clearTimeout,ns=Lo.floor,es=ba(es=Wo.getPrototypeOf)&&es,rs=Po.push,is=Ho.propertyIsEnumerable,as=ba(as=t.Set)&&as,os=t.setTimeout,ss=Po.splice,us=ba(us=t.Uint8Array)&&us,cs=(Po.unshift,ba(cs=t.WeakMap)&&cs),fs=function(){try{var n=ba(n=t.Float64Array)&&n,e=new n(new Jo(10),0,1)&&n}catch(r){}return e}(),ls=ba(ls=Yo.isArray)&&ls,hs=ba(hs=Wo.create)&&hs,ds=t.isFinite,ps=ba(ps=Wo.keys)&&ps,_s=Lo.max,vs=Lo.min,gs=ba(gs=Io.now)&&gs,ms=ba(ms=Uo.isFinite)&&ms,ys=t.parseInt,ws=Lo.random,Ts=Uo.NEGATIVE_INFINITY,Ds=Uo.POSITIVE_INFINITY,bs=Lo.pow(2,32)-1,Os=bs-1,ks=bs>>>1,Ms=fs?fs.BYTES_PER_ELEMENT:0,As=Lo.pow(2,53)-1,Ss=cs&&new cs,Cs=n.support={};!functLine truncated
|
||||
break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":t=t.substr(0,1);case"gggg":case"GGGG":case"GGGGG":t=t.substr(0,2),n&&(e._w=e._w||{},e._w[t]=x(n));break;case"gg":case"GG":e._w=e._w||{},e._w[t]=An.parseTwoDigitYear(n)}}function J(t){var n,e,r,i,a,s,u;n=t._w,null!=n.GG||null!=n.W||null!=n.E?(a=1,s=4,e=o(n.GG,t._a[Nn],_n(An(),1,4).year),r=o(n.W,1),i=o(n.E,1)):(a=t._locale._week.dow,s=t._locale._week.doy,e=o(n.gg,t._a[Nn],_n(An(),a,s).year),r=o(n.w,1),null!=n.d?(i=n.d,a>i&&++r):i=null!=n.e?n.e+a:a),u=vn(e,r,i,s,a),t._a[Nn]=u.year,t._dayOfYear=u.dayOfYear}function X(t){var n,e,r,i,a=[];if(!t._d){for(r=tn(t),t._w&&null==t._a[Un]&&null==t._a[Ln]&&J(t),t._dayOfYear&&(i=o(t._a[Nn],r[Nn]),t._dayOfYear>U(i)&&(t._pf._overflowDayOfYear=!0),e=ln(i,0,t._dayOfYear),t._a[Ln]=e.getUTCMonth(),t._a[Un]=e.getUTCDate()),n=0;3>n&&null==t._a[n];++n)t._a[n]=a[n]=r[n];for(;7>n;n++)t._a[n]=a[n]=null==t._a[n]?2===n?1:0:t._a[n];24===t._a[Wn]&&0===t._a[Fn]&&0===t._a[Gn]&&0===t._a[jn]&&(t._nextDay=!0,t._a[Wn]=0),t._d=(t._useUTC?ln:fn).apply(null,a),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Wn]=24)}}function Q(t){var n;t._d||(n=Y(t._i),t._a=[n.year,n.month,n.day||n.date,n.hour,n.minute,n.second,n.millisecond],X(t))}function tn(t){var n=new Date;return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function nn(t){if(t._f===An.ISO_8601)return void on(t);t._a=[],t._pf.empty=!0;var n,e,r,i,o,s=""+t._i,u=s.length,c=0;for(r=Z(t._f,t._locale).match(Zn)||[],n=0;n<r.length;n++)i=r[n],e=(s.match(q(i,t))||[])[0],e&&(o=s.substr(0,s.indexOf(e)),o.length>0&&t._pf.unusedInput.push(o),s=s.slice(s.indexOf(e)+e.length),c+=e.length),be[i]?(e?t._pf.empty=!1:t._pf.unusedTokens.push(i),K(i,e,t)):t._strict&&!e&&t._pf.unusedTokens.push(i);t._pf.charsLeftOver=u-c,s.length>0&&t._pf.unusedInput.push(s),t._pf.bigHour===!0&&t._a[Wn]<=12&&(t._pf.bigHour=a),t._a[Wn]=_(t._locale,t._a[Wn],t._meridiem),X(t),F(t)}function en(t){return t.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,e,r,i){return n||e||r||i})}function rn(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function an(t){var n,e,r,i,a;if(0===t._f.length)return t._pf.invalidFormat=!0,void(t._d=new Date(0/0));for(i=0;i<t._f.length;i++)a=0,n=w({},t),null!=t._useUTC&&(n._useUTC=t._useUTC),n._pf=u(),n._f=t._f[i],nn(n),G(n)&&(a+=n._pf.charsLeftOver,a+=10*n._pf.unusedTokens.length,n._pf.score=a,(null==r||r>a)&&(r=a,e=n));y(t,e||n)}function on(t){var n,e,r=t._i,i=le.exec(r);if(i){for(t._pf.iso=!0,n=0,e=de.length;e>n;n++)if(de[n][1].exec(r)){t._f=de[n][0]+(i[6]||" ");break}for(n=0,e=pe.length;e>n;n++)if(pe[n][1].exec(r)){t._f+=pe[n][0];break}r.match(ne)&&(t._f+="Z"),nn(t)}else t._isValid=!1}function sn(t){on(t),t._isValid===!1&&(delete t._isValid,An.createFromInputFallback(t))}function un(t,n){var e,r=[];for(e=0;e<t.length;++e)r.push(n(t[e],e));return r}function cn(t){var n,e=t._i;e===a?t._d=new Date:S(e)?t._d=new Date(+e):null!==(n=$n.exec(e))?t._d=new Date(+n[1]):"string"==typeof e?sn(t):A(e)?(t._a=un(e.slice(0),function(t){return parseInt(t,10)}),X(t)):"object"==typeof e?Q(t):"number"==typeof e?t._d=new Date(e):An.createFromInputFallback(t)}function fn(t,n,e,r,i,a,o){var s=new Date(t,n,e,r,i,a,o);return 1970>t&&s.setFullYear(t),s}function ln(t){var n=new Date(Date.UTC.apply(null,arguments));return 1970>t&&n.setUTCFullYear(t),n}function hn(t,n){if("string"==typeof t)if(isNaN(t)){if(t=n.weekdaysParse(t),"number"!=typeof t)return null}else t=parseInt(t,10);return t}function dn(t,n,e,r,i){return i.relativeTime(n||1,!!e,t,r)}function pn(t,n,e){var r=An.duration(t).abs(),i=In(r.as("s")),a=In(r.as("m")),o=In(r.as("h")),s=In(r.as("d")),u=In(r.as("M")),c=In(r.as("y")),f=i<we.s&&["s",i]||1===a&&["m"]||a<we.m&&["mm",a]||1===o&&["h"]||o<we.h&&["hh",o]||1===s&&["d"]||s<we.d&&["dd",s]||1===u&&["M"]||u<we.M&&["MM",u]||1===c&&["y"]||["yy",c];return f[2]=n,f[3]=+t>0,f[4]=e,dn.apply({},f)}function _n(t,n,e){var r,i=e-n,a=e-t.day();return a>i&&(a-=7),i-7>a&&(a+=7),r=An(t).add(a,"d"),{week:Math.ceil(r.dayOfYear()/7),year:r.year()}}function vn(t,n,e,r,i){var a,o,s=ln(t,0,1).getUTCDay();return s=0===s?7:s,e=null!=e?e:i,a=i-s+(s>r?7:0)-(i>s?7:0),o=7*(n-1)+(e-i)+a+1,{year:o>0?t:t-1,dayOfYear:o>0?o:U(t-1)+o}}function gn(t){var n,e=t._i,r=t._f;return t._locale=t._locale||An.localeData(t._l),null===e||r===a&&""===e?An.invalid({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),An.isMoment(e)?new g(e,!0):(r?A(r)?an(t):nn(t):cn(t),n=new g(t),n._nextDay&&(n.add(1,"d"),n._nextDay=a),n))}function mn(t,n){var e,r;if(1===n.length&&A(n[0])&&(n=n[0]),!n.length)return An();for(e=n[0],r=1;r<n.length;++r)n[r][t](e)&&(e=n[r]);return e}function yn(t,n){var e;return"string"==typeof n&&(n=t.localeData().monthsParse(n),"number"!=typeof n)?t:(e=Math.min(t.date(),N(t.year(),n)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](n,e),t)}function wn(t,n){return t._d["get"+(t._isUTC?"UTC":"")+n]()}function Tn(t,n,e){return"Month"===nLine truncated
|
||||
},h={};r.assign(h,o.prototype,{all:function(){return c(r.values(u))},get:function(t){return t=t.toLowerCase(),u[t]||null},gets:function(t){return c(r.compact(r.map(t,this.get,this)))},entityIDs:function(){return Object.keys(u)},getCustomGroups:function(){return r.filter(u,"isCustomGroup")}}),h.dispatchToken=i.register(function(t){switch(t.actionType){case a.ACTION_NEW_STATES:f(t.states,t.replace),h.emitChange();break;case a.ACTION_LOG_OUT:u={},h.emitChange()}}),t.exports=h},function(t,n,e){"use strict";var r=e(3),i=e(2),a=e(1),o=e(5),s=6e4,u=null,c={},f={},l={};r.assign(l,o.prototype,{isStale:function(t){var n=r.isUndefined(t)?u:c[t]||null;return null===n||(new Date).getTime()-n.getTime()>s},get:function(t){return f[t]||null},all:function(){return r.values(f)}}),l.dispatchToken=i.register(function(t){switch(t.actionType){case a.ACTION_NEW_STATE_HISTORY:r.forEach(t.stateHistory,function(t){if(0!==t.length){var n=t[0].entity_id;f[n]=t,c[n]=new Date}}),t.isFetchAll&&(u=new Date),l.emitChange();break;case a.ACTION_LOG_OUT:u=null,c={},f={},l.emitChange()}}),t.exports=l},function(t,n,e){"use strict";var r=e(3),i=e(2),a=e(1),o=e(5),s=!1,u=[],c=function(t){return-1!==u.indexOf(t)},f=function(){return 4===u.length},l={};r.assign(l,o.prototype,{isFetching:function(){return!f()},initialLoadDone:function(){return s},componentsLoaded:function(){return c(a.ACTION_NEW_LOADED_COMPONENTS)},eventsLoaded:function(){return c(a.ACTION_NEW_EVENTS)},servicesLoaded:function(){return c(a.ACTION_NEW_SERVICES)},statesLoaded:function(){return c(a.ACTION_NEW_STATES)}}),l.dispatchToken=i.register(function(t){switch(t.actionType){case a.ACTION_FETCH_ALL:u=[],l.emitChange();break;case a.ACTION_NEW_LOADED_COMPONENTS:case a.ACTION_NEW_EVENTS:case a.ACTION_NEW_SERVICES:case a.ACTION_NEW_STATES:c(t.actionType)||(u.push(t.actionType),s=s||f(),l.emitChange());break;case a.ACTION_LOG_OUT:s=!1,u=[],l.emitChange()}}),t.exports=l}]);</script><script>PolymerExpressions.prototype.relativeHATime=function(timeString){return window.hass.util.relativeTime(timeString)};PolymerExpressions.prototype.HATimeStripDate=function(timeString){return(timeString||"").split(" ")[0]};</script><polymer-element name="home-assistant-api" attributes="auth" assetpath="polymer/"><template><paper-toast id="toast" role="alert" text=""></paper-toast><more-info-dialog id="moreInfoDialog"></more-info-dialog></template><script>Polymer("home-assistant-api",{ready:function(){var state,actions=window.hass.actions,dispatcher=window.hass.dispatcher;var uiActions=window.hass.uiActions={ACTION_SHOW_TOAST:actions.ACTION_SHOW_TOAST,ACTION_SHOW_DIALOG_MORE_INFO:"ACTION_SHOW_DIALOG_MORE_INFO",showMoreInfoDialog:function(entityId){dispatcher.dispatch({actionType:this.ACTION_SHOW_DIALOG_MORE_INFO,entityId:entityId})}};var getState=function(entityId){return window.hass.stateStore.get(entityId)};dispatcher.register(function(payload){switch(payload.actionType){case actions.ACTION_SHOW_TOAST:this.$.toast.text=payload.message;this.$.toast.show();break;case uiActions.ACTION_SHOW_DIALOG_MORE_INFO:state=getState(payload.entityId);this.$.moreInfoDialog.show(state);break}}.bind(this));if(this.auth){window.hass.authActions.validate(this.auth)}}});</script></polymer-element></div>
|
||||
</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
|
||||
<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.
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
"paper-button": "Polymer/paper-button#~0.5.4",
|
||||
"paper-input": "Polymer/paper-input#~0.5.4",
|
||||
"paper-toggle-button": "polymer/paper-toggle-button#~0.5.4",
|
||||
"paper-tabs": "polymer/paper-tabs#~0.5.4",
|
||||
"paper-icon-button": "polymer/paper-icon-button#~0.5.4",
|
||||
"paper-menu-button": "polymer/paper-menu-button#~0.5.4",
|
||||
"paper-dropdown": "polymer/paper-dropdown#~0.5.4",
|
||||
@@ -37,6 +36,7 @@
|
||||
"color-picker-element": "~0.0.2",
|
||||
"google-apis": "GoogleWebComponents/google-apis#~0.4.2",
|
||||
"core-drawer-panel": "polymer/core-drawer-panel#~0.5.4",
|
||||
"core-scroll-header-panel": "polymer/core-scroll-header-panel#~0.5.4"
|
||||
"core-scroll-header-panel": "polymer/core-scroll-header-panel#~0.5.4",
|
||||
"moment": "~2.9.0"
|
||||
}
|
||||
}
|
||||
@@ -68,6 +68,8 @@
|
||||
|
||||
// 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;
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
<link rel="import" href="./dialogs/more-info-dialog.html">
|
||||
|
||||
<script src="./home-assistant-js/dist/homeassistant.min.js"></script>
|
||||
<script src="./bower_components/moment/moment.js"></script>
|
||||
|
||||
<script>
|
||||
var DOMAINS_WITH_CARD = ['thermostat', 'configurator'];
|
||||
var DOMAINS_WITH_MORE_INFO = ['light', 'group', 'sun', 'configurator'];
|
||||
|
||||
// Register some polymer filters
|
||||
PolymerExpressions.prototype.relativeHATime = function(timeString) {
|
||||
return window.hass.util.relativeTime(timeString);
|
||||
@@ -12,6 +16,40 @@
|
||||
PolymerExpressions.prototype.HATimeStripDate = function(timeString) {
|
||||
return (timeString || "").split(' ')[0];
|
||||
};
|
||||
|
||||
// Add some frontend specific helpers to the models
|
||||
Object.defineProperties(window.hass.stateModel.prototype, {
|
||||
// how to render the card for this state
|
||||
cardType: {
|
||||
get: function() {
|
||||
if(DOMAINS_WITH_CARD.indexOf(this.domain) !== -1) {
|
||||
return this.domain;
|
||||
} else if(this.canToggle) {
|
||||
return "toggle";
|
||||
} else {
|
||||
return "display";
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// how to render the more info of this state
|
||||
moreInfoType: {
|
||||
get: function() {
|
||||
if(DOMAINS_WITH_MORE_INFO.indexOf(this.domain) !== -1) {
|
||||
return this.domain;
|
||||
} else {
|
||||
return 'default';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
relativeLastChanged: {
|
||||
get: function() {
|
||||
return moment(this.lastChangedAsDate).fromNow();
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<polymer-element name="home-assistant-api" attributes="auth">
|
||||
|
||||
Reference in new issue
Block a user