|
|
|
@@ -62,15 +62,16 @@ if(this.removeAttribute(a),d)return j(this,a,c);var e=c,f=m(this,a,e);return j(t
|
|
|
|
|
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-content" attributes="api stateObj" assetpath="polymer/cards/"><template><style>:host{display:block}</style><div id="card"></div></template><script>Polymer("state-card-content",{stateObjChanged:function(){while(this.$.card.lastChild){this.$.card.removeChild(this.$.card.lastChild)}var stateCard=document.createElement("state-card-"+this.stateObj.cardType);stateCard.api=this.api;stateCard.stateObj=this.stateObj;this.$.card.appendChild(stateCard)}});</script></polymer-element><polymer-element name="state-card" attributes="api stateObj" on-click="cardClicked" assetpath="polymer/cards/"><template><style>:host{background-color:#fff;border-radius:2px;box-shadow:rgba(0,0,0,.098) 0 2px 4px,rgba(0,0,0,.098) 0 0 3px;transition:all .3s ease-out;position:relative;background-color:#fff;padding:16px;width:100%;cursor:pointer}</style><state-card-content stateobj="{{stateObj}}" api="{{api}}"></state-card-content></template><script>Polymer("state-card",{cardClicked:function(){this.api.showmoreInfoDialog(this.stateObj.entity_id)}});</script></polymer-element><polymer-element name="state-cards" attributes="api filter" assetpath="polymer/components/"><template><style>:host{display:block;width:100%}@media all and (min-width:764px){:host{padding-bottom:8px}.state-card{width:calc(50% - 44px);margin:8px 0 0 8px}}@media all and (min-width:1100px){.state-card{width:calc(33% - 38px)}}@media all and (min-width:1450px){.state-card{width:calc(25% - 42px)}}</style><div horizontal="" layout="" wrap=""><template repeat="{{states as state}}"><state-card class="state-card" stateobj="{{state}}" api="{{api}}"></state-card></template></div></template><script>Polymer("state-cards",{filter:null,states:[],observe:{"api.states":"filterChanged"},filterChanged:function(){if(this.filter==="customgroup"){this.states=this.api.getCustomGroups()}else{this.states=this.api.states.filter(function(state){return state.domain!="group"})}}});</script></polymer-element><polymer-element name="home-assistant-main" attributes="api" assetpath="polymer/"><template><style>core-header-panel{-webkit-overflow-scrolling:touch;background-color:#E5E5E5}core-toolbar{background:#03a9f4;color:#fff}core-toolbar.tall{height:128px}core-toolbar .bottom{opacity:0;transition:opacity .3s ease-out}core-toolbar.tall .bottom{opacity:1}paper-tab{text-transform:uppercase}paper-menu-button{margin-top:5px!important}paper-dropdown{border-radius:3px}paper-dropdown .menu{margin:0;padding:8px 0;color:#000}paper-item{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}paper-item a{text-decoration:none}</style><core-header-panel fit="" mode="{{hasCustomGroups && 'waterfall-tall'}}"><core-toolbar><div flex="">Home Assistant</div><paper-icon-button icon="refresh" on-click="{{handleRefreshClick}}"></paper-icon-button><paper-icon-button icon="settings-remote" on-click="{{handleServiceClick}}"></paper-icon-button><paper-menu-button><paper-icon-button icon="more-vert" noink=""></paper-icon-button><paper-dropdown halign="right" duration="200" class="dropdown"><core-menu class="menu"><paper-item><a on-click="{{handleAddStateClick}}">Set State</a></paper-item><paper-item><a on-click="{{handleEventClick}}">Trigger Event</a></paper-item><paper-item><a on-click="{{handleLogOutClick}}">Log Out</a></paper-item></core-menu></paper-dropdown></paper-menu-button><div class="bottom fit" horizontal="" layout=""><paper-tabs id="tabsHolder" noink="" flex="" selected="0" on-core-select="{{tabClicked}}"><paper-tab>ALL</paper-tab><paper-tab data-filter="customgroup">GROUPS</paper-tab></paper-tabs></div></core-toolbar><state-cards api="{{api}}" filter="{{selectedFilter}}" class="content"></state-cards></core-header-panel></template><script>Polymer("home-assistant-main",{selectedFilter:null,hasCustomGroups:false,observe:{"api.states":"updateHasCustomGroup"},tabClicked:function(ev){if(ev.detail.isSelected){this.selectedFilter=ev.detail.item.getAttribute("data-filter")}},handleRefreshClick:function(){this.api.fetchAll()},handleEventClick:function(){this.api.showFireEventDialog()},handleServiceClick:function(){this.api.showCallServiceDialog()},handleAddStateClick:function(){this.api.showSetStateDialog()},handleLogOutClick:function(){this.api.logOut()},updateHasCustomGroup:function(){this.hasCustomGroups=this.api.getCustomGroups().length>0}});</script></polymer-element></div>
|
|
|
|
|
<div hidden><script>(function(undefined){var moment,VERSION="2.8.4",globalScope=typeof global!=="undefined"?global:this,oldGlobalMoment,round=Math.round,hasOwnProperty=Object.prototype.hasOwnProperty,i,YEAR=0,MONTH=1,DATE=2,HOUR=3,MINUTE=4,SECOND=5,MILLISECOND=6,locales={},momentProperties=[],hasModule=typeof module!=="undefined"&&module&&module.exports,aspNetJsonRegex=/^\/?Date\((\-?\d+)/i,aspNetTimeSpanJsonRegex=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,isoDurationRegex=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,formattingTokens=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,parseTokenOneOrTwoDigits=/\d\d?/,parseTokenOneToThreeDigits=/\d{1,3}/,parseTokenOneToFourDigits=/\d{1,4}/,parseTokenOneToSixDigits=/[+\-]?\d{1,6}/,parseTokenDigits=/\d+/,parseTokenWord=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,parseTokenTimezone=/Z|[\+\-]\d\d:?\d\d/gi,parseTokenT=/T/i,parseTokenOffsetMs=/[\+\-]?\d+/,parseTokenTimestampMs=/[\+\-]?\d+(\.\d{1,3})?/,parseTokenOneDigit=/\d/,parseTokenTwoDigits=/\d\d/,parseTokenThreeDigits=/\d{3}/,parseTokenFourDigits=/\d{4}/,parseTokenSixDigits=/[+-]?\d{6}/,parseTokenSignedNumber=/[+-]?\d+/,isoRegex=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,isoFormat="YYYY-MM-DDTHH:mm:ssZ",isoDates=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],isoTimes=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],parseTimezoneChunker=/([\+\-]|\d\d)/gi,proxyGettersAndSetters="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),unitMillisecondFactors={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},unitAliases={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},camelFunctions={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},formatFunctions={},relativeTimeThresholds={s:45,m:45,h:22,d:26,M:11},ordinalizeTokens="DDD w W M D d".split(" "),paddedTokens="M D H h m s w W".split(" "),formatTokenFunctions={M:function(){return this.month()+1},MMM:function(format){return this.localeData().monthsShort(this,format)},MMMM:function(format){return this.localeData().months(this,format)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(format){return this.localeData().weekdaysMin(this,format)},ddd:function(format){return this.localeData().weekdaysShort(this,format)},dddd:function(format){return this.localeData().weekdays(this,format)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return leftZeroFill(this.year()%100,2)},YYYY:function(){return leftZeroFill(this.year(),4)},YYYYY:function(){return leftZeroFill(this.year(),5)},YYYYYY:function(){var y=this.year(),sign=y>=0?"+":"-";return sign+leftZeroFill(Math.abs(y),6)},gg:function(){return leftZeroFill(this.weekYear()%100,2)},gggg:function(){return leftZeroFill(this.weekYear(),4)},ggggg:function(){return leftZeroFill(this.weekYear(),5)},GG:function(){return leftZeroFill(this.isoWeekYear()%100,2)},GGGG:function(){return leftZeroFill(this.isoWeekYear(),4)},GGGGG:function(){return leftZeroFill(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),true)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),false)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return toInt(this.milliseconds()/100)},SS:function(){return leftZeroFill(toInt(this.milliseconds()/10),2)},SSS:function(){return leftZeroFill(this.milliseconds(),3)},SSSS:function(){return leftZeroFill(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";if(a<0){a=-a;b="-"}return b+leftZeroFill(toInt(a/60),2)+":"+leftZeroFill(toInt(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";if(a<0){a=-a;b="-"}return b+leftZeroFill(toInt(a/60),2)+leftZeroFill(toInt(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},x:function(){return this.valueOf()},X:function(){return this.unix()},Q:function(){return this.quarter()}},deprecations={},lists=["months","monthsShort","weekdaLine truncated
|
|
|
|
|
}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(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)};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.zone(0,keepLocalTime)},local:function(keepLocalTime){if(this._isUTC){this.zone(0,keepLocalTime);this._isUTC=false;if(keepLocalTime){this.add(this._dateTzOffset(),"m")}}return this},format:function(inputString){var output=formatMoment(this,inputString||moment.defaultFormat);return this.localeData().postformat(output)},add:createAdder(1,"add"),subtract:createAdder(-1,"subtract"),diff:function(input,units,asFloat){var that=makeAs(input,this),zoneDiff=(this.zone()-that.zone())*6e4,diff,output,daysAdjust;units=normalizeUnits(units);if(units==="year"||units==="month"){diff=(this.daysInMonth()+that.daysInMonth())*432e5;output=(this.year()-that.year())*12+(this.month()-that.month());daysAdjust=this-moment(this).startOf("month")-(that-moment(that).startOf("month"));daysAdjust-=(this.zone()-moment(this).startOf("month").zone()-(that.zone()-moment(that).startOf("month").zone()))*6e4;output+=daysAdjust/diff;if(units==="year"){output=output/12}}else{diff=this-that;output=units==="second"?diff/1e3:units==="minute"?diff/6e4:units==="hour"?diff/36e5:units==="day"?(diff-zoneDiff)/864e5:units==="week"?(diff-zoneDiff)/6048e5:diff}return asFloat?output:absRound(output)},from:function(time,withoutSuffix){return moment.duration({to:this,from:time}).locale(this.locale()).humanize(!withoutSuffix)},fromNowLine truncated
|
|
|
|
|
}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(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)};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.zone(0,keepLocalTime)},local:function(keepLocalTime){if(this._isUTC){this.zone(0,keepLocalTime);this._isUTC=false;if(keepLocalTime){this.add(this._dateTzOffset(),"m")}}return this},format:function(inputString){var output=formatMoment(this,inputString||moment.defaultFormat);return this.localeData().postformat(output)},add:createAdder(1,"add"),subtract:createAdder(-1,"subtract"),diff:function(input,units,asFloat){var that=makeAs(input,this),zoneDiff=(this.zone()-that.zone())*6e4,diff,output,daysAdjust;units=normalizeUnits(units);if(units==="year"||units==="month"){diff=(this.daysInMonth()+that.daysInMonth())*432e5;output=(this.year()-that.year())*12+(this.month()-that.month());daysAdjust=this-moment(this).startOf("month")-(that-moment(that).startOf("month"));daysAdjust-=(this.zone()-moment(this).startOf("month").zone()-(that.zone()-moment(that).startOf("month").zone()))*6e4;output+=daysAdjust/diff;if(units==="year"){output=output/12}}else{diff=this-that;output=units==="second"?diff/1e3:units==="minute"?diff/6e4:units==="hour"?diff/36e5:units==="day"?(diff-zoneDiff)/864e5:units==="week"?(diff-zoneDiff)/6048e5:diff}return asFloat?output:absRound(output)},from:function(time,withoutSuffix){return moment.duration({to:this,from:time}).locale(this.locale()).humanize(!withoutSuffix)},fromNowLine truncated
|
|
|
|
|
({{event.listener_count}} listeners)
|
|
|
|
|
</div></template></div></template><script>Polymer("events-list",{cbEventClicked:null,events:[],domReady:function(){this.events=this.api.events;this.api.addEventListener("events-updated",this.eventsUpdated.bind(this))},eventsUpdated:function(){this.events=this.api.events},handleClick:function(ev){if(this.cbEventClicked){this.cbEventClicked(ev.path[0].innerHTML)}}});</script></polymer-element><polymer-element name="event-fire-dialog" attributes="api" assetpath="polymer/dialogs/"><template><ha-action-dialog id="dialog" heading="Fire Event" class="two-column"><div layout="" horizontal=""><div class="ha-form"><paper-input id="inputType" label="Event Type" floatinglabel="true" autofocus required></paper-input><paper-input-decorator label="Event Data (JSON, optional)" floatinglabel="true"><textarea id="inputData" rows="5"></textarea></paper-input-decorator></div><div class="sidebar"><b>Available events:</b><events-list api="{{api}}" cbeventclicked="{{eventSelected}}"></events-list></div></div><paper-button dismissive="">Cancel</paper-button><paper-button affirmative="" on-click="{{clickFireEvent}}">Fire Event</paper-button></ha-action-dialog></template><script>Polymer("event-fire-dialog",{ready:function(){this.eventSelected=this.eventSelected.bind(this)},show:function(eventType,eventData){this.setEventType(eventType);this.setEventData(eventData);this.$.dialog.toggle()},setEventType:function(eventType){this.$.inputType.value=eventType},setEventData:function(eventData){this.$.inputData.value=eventData},eventSelected:function(eventType){this.setEventType(eventType)},clickFireEvent:function(){var data;if(this.$.inputData.value!==""){data=JSON.parse(this.$.inputData.value)}else{data={}}this.api.fire_event(this.$.inputType.value,data)}});</script></polymer-element><polymer-element name="core-item" attributes="label icon src" horizontal="" center="" layout="" assetpath="polymer/bower_components/core-item/"><template><style>:host{display:block;position:relative;min-height:40px;white-space:nowrap}:host(.font-scalable){min-height:2.5em}:host(.core-selected){font-weight:700}#icon{margin:0 16px 0 4px}:host(.font-scalable) #icon{margin:0 1em 0 .25em;height:1.5em;width:1.5em}polyfill-next-selector{content:':host > a'}::content>a{position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.000001)}</style><template if="{{icon || src}}"><core-icon src="{{src}}" id="icon" icon="{{icon}}" hidden?="{{!src && !icon}}"></core-icon></template><div id="label">{{label}}</div><content></content></template><script>Polymer("core-item",{});</script></polymer-element><style shim-shadowdom="">html /deep/ core-collapse{display:block}html /deep/ .core-collapse-closed{display:none}</style><polymer-element name="core-collapse" attributes="target horizontal opened duration fixedSize allowOverflow" assetpath="polymer/bower_components/core-collapse/"><template><content></content></template><script>Polymer("core-collapse",{target:null,horizontal:false,opened:false,duration:.33,fixedSize:false,allowOverflow:false,created:function(){this.transitionEndListener=this.transitionEnd.bind(this)},ready:function(){this.target=this.target||this},domReady:function(){this.async(function(){this.afterInitialUpdate=true})},detached:function(){if(this.target){this.removeListeners(this.target)}},targetChanged:function(old){if(old){this.removeListeners(old)}if(!this.target){return}this.isTargetReady=!!this.target;this.classList.toggle("core-collapse-closed",this.target!==this);this.toggleOpenedStyle(false);this.horizontalChanged();this.addListeners(this.target);this.toggleClosedClass(true);this.update()},addListeners:function(node){node.addEventListener("transitionend",this.transitionEndListener)},removeListeners:function(node){node.removeEventListener("transitionend",this.transitionEndListener)},horizontalChanged:function(){this.dimension=this.horizontal?"width":"height"},openedChanged:function(){this.update();this.fire("core-collapse-open",this.opened)},toggle:function(){this.opened=!this.opened},setTransitionDuration:function(duration){var s=this.target.style;s.transition=duration?this.dimension+" "+duration+"s":null;if(duration===0){this.async("transitionEnd")}},transitionEnd:function(){if(this.opened&&!this.fixedSize){this.updateSize("auto",null)}this.setTransitionDuration(null);this.toggleOpenedStyle(this.opened);this.toggleClosedClass(!this.opened);this.asyncFire("core-resize",null,this.target)},toggleClosedClass:function(closed){this.hasClosedClass=closed;this.target.classList.toggle("core-collapse-closed",closed)},toggleOpenedStyle:function(opened){this.target.style.overflow=this.allowOverflow&&opened?"":"hidden"},updateSize:function(size,duration,forceEnd){this.setTransitionDuration(duration);this.calcSize();var s=this.target.style;var nochange=s[this.dimension]===size;s[this.dimension]=size;if(forceEnd&&nochange){this.transitionEnd()}},update:function(){if(!this.target){return}if(!this.isTargetReady){this.targetChanged()}this.horizontLine truncated
|
|
|
|
|
This dialog will update the representation of the device within Home Assistant. This will not communicate with the actual device.
|
|
|
|
|
</p><div layout="" horizontal=""><div class="ha-form"><paper-input id="inputEntityID" label="Entity ID" floatinglabel="true" autofocus required></paper-input><paper-input id="inputState" label="State" floatinglabel="true" required></paper-input><paper-input-decorator label="State attributes (JSON, optional)" floatinglabel="true"><textarea id="inputData" rows="5"></textarea></paper-input-decorator></div><div class="sidebar"><b>Current entities:</b><entity-list api="{{api}}" cbentityclicked="{{entitySelected}}"></entity-list></div></div><paper-button dismissive="">Cancel</paper-button><paper-button affirmative="" on-click="{{clickSetState}}">Set State</paper-button></ha-action-dialog></template><script>Polymer("state-set-dialog",{ready:function(){this.entitySelected=this.entitySelected.bind(this)},show:function(entityId,state,stateData){this.setEntityId(entityId);this.setState(state);this.setStateData(stateData);this.$.dialog.toggle()},setEntityId:function(entityId){this.$.inputEntityID.value=entityId},setState:function(state){this.$.inputState.value=state},setStateData:function(stateData){var value=stateData?JSON.stringify(stateData,null," "):"";this.$.inputData.value=value},entitySelected:function(entityId){this.setEntityId(entityId);var state=this.api.getState(entityId);this.setState(state.state);this.setStateData(state.attributes)},clickSetState:function(){this.api.set_state(this.$.inputEntityID.value,this.$.inputState.value,JSON.parse(this.$.inputData.value))}});</script></polymer-element><polymer-element name="more-info-default" attributes="stateObj" assetpath="polymer/more-infos/"><template><style>.data-entry{margin-bottom:8px}.data-entry:last-child{margin-bottom:0}.data{padding-left:10px;text-align:right;word-break:break-all;max-width:200px}</style><div layout="" vertical=""><template repeat="{{key in stateObj.attributes | getKeys}}"><div layout="" justified="" horizontal="" class="data-entry" id="rising"><div>
|
|
|
|
|
</div></template></div></template><script>Polymer("events-list",{cbEventClicked:null,events:[],domReady:function(){this.events=this.api.events;this.api.addEventListener("events-updated",this.eventsUpdated.bind(this))},eventsUpdated:function(){this.events=this.api.events},handleClick:function(ev){if(this.cbEventClicked){this.cbEventClicked(ev.path[0].innerHTML)}}});</script></polymer-element><polymer-element name="event-fire-dialog" attributes="api" assetpath="polymer/dialogs/"><template><ha-action-dialog id="dialog" heading="Fire Event" class="two-column" closeselector="[dismissive]"><div layout="" horizontal=""><div class="ha-form"><paper-input id="inputType" label="Event Type" floatinglabel="true" autofocus required></paper-input><paper-input-decorator label="Event Data (JSON, optional)" floatinglabel="true"><textarea id="inputData" rows="5"></textarea></paper-input-decorator></div><div class="sidebar"><b>Available events:</b><events-list api="{{api}}" cbeventclicked="{{eventSelected}}"></events-list></div></div><paper-button dismissive="">Cancel</paper-button><paper-button affirmative="" on-click="{{clickFireEvent}}">Fire Event</paper-button></ha-action-dialog></template><script>Polymer("event-fire-dialog",{ready:function(){this.eventSelected=this.eventSelected.bind(this)},show:function(eventType,eventData){this.setEventType(eventType);this.setEventData(eventData);this.job("showDialogAfterRender",function(){this.$.dialog.toggle()}.bind(this))},setEventType:function(eventType){this.$.inputType.value=eventType},setEventData:function(eventData){this.$.inputData.value=eventData},eventSelected:function(eventType){this.setEventType(eventType)},clickFireEvent:function(){try{this.api.fire_event(this.$.inputType.value,this.$.inputData.value?JSON.parse(this.$.inputData.value):{});this.$.dialog.close()}catch(err){alert("Error parsing JSON: "+err)}}});</script></polymer-element><polymer-element name="core-item" attributes="label icon src" horizontal="" center="" layout="" assetpath="polymer/bower_components/core-item/"><template><style>:host{display:block;position:relative;min-height:40px;white-space:nowrap}:host(.font-scalable){min-height:2.5em}:host(.core-selected){font-weight:700}#icon{margin:0 16px 0 4px}:host(.font-scalable) #icon{margin:0 1em 0 .25em;height:1.5em;width:1.5em}polyfill-next-selector{content:':host > a'}::content>a{position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.000001)}</style><template if="{{icon || src}}"><core-icon src="{{src}}" id="icon" icon="{{icon}}" hidden?="{{!src && !icon}}"></core-icon></template><div id="label">{{label}}</div><content></content></template><script>Polymer("core-item",{});</script></polymer-element><style shim-shadowdom="">html /deep/ core-collapse{display:block}html /deep/ .core-collapse-closed{display:none}</style><polymer-element name="core-collapse" attributes="target horizontal opened duration fixedSize allowOverflow" assetpath="polymer/bower_components/core-collapse/"><template><content></content></template><script>Polymer("core-collapse",{target:null,horizontal:false,opened:false,duration:.33,fixedSize:false,allowOverflow:false,created:function(){this.transitionEndListener=this.transitionEnd.bind(this)},ready:function(){this.target=this.target||this},domReady:function(){this.async(function(){this.afterInitialUpdate=true})},detached:function(){if(this.target){this.removeListeners(this.target)}},targetChanged:function(old){if(old){this.removeListeners(old)}if(!this.target){return}this.isTargetReady=!!this.target;this.classList.toggle("core-collapse-closed",this.target!==this);this.toggleOpenedStyle(false);this.horizontalChanged();this.addListeners(this.target);this.toggleClosedClass(true);this.update()},addListeners:function(node){node.addEventListener("transitionend",this.transitionEndListener)},removeListeners:function(node){node.removeEventListener("transitionend",this.transitionEndListener)},horizontalChanged:function(){this.dimension=this.horizontal?"width":"height"},openedChanged:function(){this.update();this.fire("core-collapse-open",this.opened)},toggle:function(){this.opened=!this.opened},setTransitionDuration:function(duration){var s=this.target.style;s.transition=duration?this.dimension+" "+duration+"s":null;if(duration===0){this.async("transitionEnd")}},transitionEnd:function(){if(this.opened&&!this.fixedSize){this.updateSize("auto",null)}this.setTransitionDuration(null);this.toggleOpenedStyle(this.opened);this.toggleClosedClass(!this.opened);this.asyncFire("core-resize",null,this.target)},toggleClosedClass:function(closed){this.hasClosedClass=closed;this.target.classList.toggle("core-collapse-closed",closed)},toggleOpenedStyle:function(opened){this.target.style.overflow=this.allowOverflow&&opened?"":"hidden"},updateSize:function(size,duration,forceEnd){this.setTransitionDuration(duration);this.calcSize();var s=this.target.style;var nochange=s[this.dimension]===size;s[this.dimension]=size;if(forceEnd&&nochange){thiLine truncated
|
|
|
|
|
This dialog will update the representation of the device within Home Assistant.<br>
|
|
|
|
|
This will not communicate with the actual device.
|
|
|
|
|
</p><div layout="" horizontal=""><div class="ha-form"><paper-input id="inputEntityID" label="Entity ID" floatinglabel="true" autofocus required></paper-input><paper-input id="inputState" label="State" floatinglabel="true" required></paper-input><paper-input-decorator label="State attributes (JSON, optional)" floatinglabel="true"><textarea id="inputData" rows="5"></textarea></paper-input-decorator></div><div class="sidebar"><b>Current entities:</b><entity-list api="{{api}}" cbentityclicked="{{entitySelected}}"></entity-list></div></div><paper-button dismissive="">Cancel</paper-button><paper-button affirmative="" on-click="{{clickSetState}}">Set State</paper-button></ha-action-dialog></template><script>Polymer("state-set-dialog",{ready:function(){this.entitySelected=this.entitySelected.bind(this)},show:function(entityId,state,stateData){this.setEntityId(entityId);this.setState(state);this.setStateData(stateData);this.job("showDialogAfterRender",function(){this.$.dialog.toggle()}.bind(this))},setEntityId:function(entityId){this.$.inputEntityID.value=entityId},setState:function(state){this.$.inputState.value=state},setStateData:function(stateData){var value=stateData?JSON.stringify(stateData,null," "):"";this.$.inputData.value=value},entitySelected:function(entityId){this.setEntityId(entityId);var state=this.api.getState(entityId);this.setState(state.state);this.setStateData(state.attributes)},clickSetState:function(ev){try{this.api.set_state(this.$.inputEntityID.value,this.$.inputState.value,this.$.inputData.value?JSON.parse(this.$.inputData.value):{});this.$.dialog.close()}catch(err){alert("Error parsing JSON: "+err)}}});</script></polymer-element><polymer-element name="more-info-default" attributes="stateObj" assetpath="polymer/more-infos/"><template><style>.data-entry{margin-bottom:8px}.data-entry:last-child{margin-bottom:0}.data{padding-left:10px;text-align:right;word-break:break-all;max-width:200px}</style><div layout="" vertical=""><template repeat="{{key in stateObj.attributes | getKeys}}"><div layout="" justified="" horizontal="" class="data-entry" id="rising"><div>
|
|
|
|
|
{{key}}
|
|
|
|
|
</div><div class="data">
|
|
|
|
|
{{stateObj.attributes[key]}}
|
|
|
|
|
</div></div></template></div></template><script>Polymer("more-info-default",{getKeys:function(obj){return Object.keys(obj||{})}});</script></polymer-element><polymer-element name="core-range" attributes="value min max step ratio" assetpath="polymer/bower_components/core-range/"><script>Polymer("core-range",{value:0,min:0,max:100,step:1,ratio:0,observe:{"value min max step":"update"},calcRatio:function(value){return(this.clampValue(value)-this.min)/(this.max-this.min)},clampValue:function(value){return Math.min(this.max,Math.max(this.min,this.calcStep(value)))},calcStep:function(value){return this.step?Math.round(value/this.step)/(1/this.step):value},validateValue:function(){var v=this.clampValue(this.value);this.value=this.oldValue=isNaN(v)?this.oldValue:v;return this.value!==v},update:function(){this.validateValue();this.ratio=this.calcRatio(this.value)*100}});</script></polymer-element><polymer-element name="paper-progress" extends="core-range" attributes="secondaryProgress indeterminate" assetpath="polymer/bower_components/paper-progress/"><template><style>:host{display:inline-block;width:200px;height:4px}#progressContainer{position:relative;height:100%;background-color:#c8c8c8;overflow:hidden}#activeProgress,#secondaryProgress{-webkit-transform-origin:left center;transform-origin:left center;-webkit-transform:scaleX(0);transform:scaleX(0)}#activeProgress{background-color:#0f9d58}#secondaryProgress{background-color:#87ceac}#activeProgress.indeterminate{-webkit-transform-origin:center center;transform-origin:center center;-webkit-animation:indeterminate-bar 1s linear infinite;animation:indeterminate-bar 1s linear infinite}@-webkit-keyframes indeterminate-bar{0%{-webkit-transform:translate(-50%) scaleX(0)}50%{-webkit-transform:translate(0%) scaleX(0.3)}100%{-webkit-transform:translate(50%) scaleX(0)}}@keyframes indeterminate-bar{0%{transform:translate(-50%) scaleX(0)}50%{transform:translate(0%) scaleX(0.3)}100%{transform:translate(50%) scaleX(0)}}</style><div id="progressContainer" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="{{min}}" aria-valuemax="{{max}}"><div id="secondaryProgress" fit=""></div><div id="activeProgress" fit=""></div></div></template><script>Polymer("paper-progress",{secondaryProgress:0,indeterminate:false,step:0,observe:{"value secondaryProgress min max indeterminate":"update"},update:function(){this.super();this.secondaryProgress=this.clampValue(this.secondaryProgress);this.secondaryRatio=this.calcRatio(this.secondaryProgress)*100;this.$.activeProgress.classList.toggle("indeterminate",this.indeterminate)},transformProgress:function(progress,ratio){var transform="scaleX("+ratio/100+")";progress.style.transform=progress.style.webkitTransform=transform},ratioChanged:function(){this.transformProgress(this.$.activeProgress,this.ratio)},secondaryRatioChanged:function(){this.transformProgress(this.$.secondaryProgress,this.secondaryRatio)}});</script></polymer-element><polymer-element name="paper-slider" extends="core-range" attributes="snaps pin disabled secondaryProgress editable immediateValue" role="slider" tabindex="0" aria-valuemin="0" aria-valuemax="100" assetpath="polymer/bower_components/paper-slider/"><template><style>:host{display:inline-block;width:200px;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}:host(:focus){outline:0}#sliderContainer{position:relative;width:calc(100% - 32px);height:32px}#sliderContainer.editable{float:left;width:calc(100% - 72px);margin:12px 0}.bar-container{position:absolute;top:0;left:16px;height:100%;width:100%;overflow:hidden}.ring>.bar-container{left:20px;width:calc(100% - 4px);transition:left .18s ease,width .18s ease}.ring.expand:not(.pin)>.bar-container{left:30px;width:calc(100% - 14px)}.ring.expand.dragging>.bar-container{transition:none}#sliderBar{position:absolute;top:15px;left:0;height:2px;width:100%;padding:8px 0;margin:-8px 0}.ring #sliderBar{left:-4px;width:calc(100% + 4px)}.ring.expand:not(.pin) #sliderBar{left:-14px;width:calc(100% + 14px)}.slider-markers{position:absolute;top:15px;left:15px;height:2px;width:calc(100% + 2px);box-sizing:border-box;pointer-events:none}.slider-markers::after,.slider-marker::after{content:"";display:block;width:2px;height:2px;border-radius:50%;background-color:#000}#sliderBar::shadow #activeProgress{background-color:#3f51b5}.transiting #sliderBar::shadow #activeProgress{transition:-webkit-transform .08s ease;transition:transform .08s ease}#sliderKnob{position:absolute;left:0;top:0;width:32px;height:32px}.transiting>#sliderKnob{transition:left .08s ease}#sliderKnob:focus{outline:0}#sliderKnob.dragging{transition:none}.snaps>#sliderKnob.dragging{transition:-webkit-transform .08s ease;transition:transform .08s ease}#sliderKnobInner{width:12px;height:12px;box-sizing:border-box;-moz-box-sizing:border-box;border-radius:50%;background-color:#3f51b5;transition:height .18s ease,width .18s ease}.expand:not(Line truncated
|
|
|
|
|
</div></div></template></div></template><script>Polymer("more-info-default",{getKeys:function(obj){return Object.keys(obj||{})}});</script></polymer-element><polymer-element name="core-range" attributes="value min max step ratio" assetpath="polymer/bower_components/core-range/"><script>Polymer("core-range",{value:0,min:0,max:100,step:1,ratio:0,observe:{"value min max step":"update"},calcRatio:function(value){return(this.clampValue(value)-this.min)/(this.max-this.min)},clampValue:function(value){return Math.min(this.max,Math.max(this.min,this.calcStep(value)))},calcStep:function(value){return this.step?Math.round(value/this.step)/(1/this.step):value},validateValue:function(){var v=this.clampValue(this.value);this.value=this.oldValue=isNaN(v)?this.oldValue:v;return this.value!==v},update:function(){this.validateValue();this.ratio=this.calcRatio(this.value)*100}});</script></polymer-element><polymer-element name="paper-progress" extends="core-range" attributes="secondaryProgress indeterminate" assetpath="polymer/bower_components/paper-progress/"><template><style>:host{display:inline-block;width:200px;height:4px}#progressContainer{position:relative;height:100%;background-color:#c8c8c8;overflow:hidden}#activeProgress,#secondaryProgress{-webkit-transform-origin:left center;transform-origin:left center;-webkit-transform:scaleX(0);transform:scaleX(0)}#activeProgress{background-color:#0f9d58}#secondaryProgress{background-color:#87ceac}#activeProgress.indeterminate{-webkit-transform-origin:center center;transform-origin:center center;-webkit-animation:indeterminate-bar 1s linear infinite;animation:indeterminate-bar 1s linear infinite}@-webkit-keyframes indeterminate-bar{0%{-webkit-transform:translate(-50%) scaleX(0)}50%{-webkit-transform:translate(0%) scaleX(0.3)}100%{-webkit-transform:translate(50%) scaleX(0)}}@keyframes indeterminate-bar{0%{transform:translate(-50%) scaleX(0)}50%{transform:translate(0%) scaleX(0.3)}100%{transform:translate(50%) scaleX(0)}}</style><div id="progressContainer" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="{{min}}" aria-valuemax="{{max}}"><div id="secondaryProgress" fit=""></div><div id="activeProgress" fit=""></div></div></template><script>Polymer("paper-progress",{secondaryProgress:0,indeterminate:false,step:0,observe:{"value secondaryProgress min max indeterminate":"update"},update:function(){this.super();this.secondaryProgress=this.clampValue(this.secondaryProgress);this.secondaryRatio=this.calcRatio(this.secondaryProgress)*100;this.$.activeProgress.classList.toggle("indeterminate",this.indeterminate)},transformProgress:function(progress,ratio){var transform="scaleX("+ratio/100+")";progress.style.transform=progress.style.webkitTransform=transform},ratioChanged:function(){this.transformProgress(this.$.activeProgress,this.ratio)},secondaryRatioChanged:function(){this.transformProgress(this.$.secondaryProgress,this.secondaryRatio)}});</script></polymer-element><polymer-element name="paper-slider" extends="core-range" attributes="snaps pin disabled secondaryProgress editable immediateValue" role="slider" tabindex="0" aria-valuemin="0" aria-valuemax="100" assetpath="polymer/bower_components/paper-slider/"><template><style>:host{display:inline-block;width:200px;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}:host(:focus){outline:0}#sliderContainer{position:relative;width:calc(100% - 32px);height:32px}#sliderContainer.editable{float:left;width:calc(100% - 72px);margin:12px 0}.bar-container{position:absolute;top:0;left:16px;height:100%;width:100%;overflow:hidden}.ring>.bar-container{left:20px;width:calc(100% - 4px);transition:left .18s ease,width .18s ease}.ring.expand:not(.pin)>.bar-container{left:30px;width:calc(100% - 14px)}.ring.expand.dragging>.bar-container{transition:none}#sliderBar{position:absolute;top:15px;left:0;height:2px;width:100%;padding:8px 0;margin:-8px 0}.ring #sliderBar{left:-4px;width:calc(100% + 4px)}.ring.expand:not(.pin) #sliderBar{left:-14px;width:calc(100% + 14px)}.slider-markers{position:absolute;top:15px;left:15px;height:2px;width:calc(100% + 2px);box-sizing:border-box;pointer-events:none}.slider-markers::after,.slider-marker::after{content:"";display:block;width:2px;height:2px;border-radius:50%;background-color:#000}#sliderBar::shadow #activeProgress{background-color:#3f51b5}.transiting #sliderBar::shadow #activeProgress{transition:-webkit-transform .08s ease;transition:transform .08s ease}#sliderKnob{position:absolute;left:0;top:0;width:32px;height:32px}.transiting>#sliderKnob{transition:left .08s ease}#sliderKnob:focus{outline:0}#sliderKnob.dragging{transition:none}.snaps>#sliderKnob.dragging{transition:-webkit-transform .08s ease;transition:transform .08s ease}#sliderKnobInner{width:12px;height:12px;box-sizing:border-box;-moz-box-sizing:border-box;border-radius:50%;background-color:#3f51b5;transition:height .18s ease,width .18s ease}.expand:not(Line truncated
|
|
|
|
|
Rising {{stateObj.attributes.next_rising | relativeHATime}}
|
|
|
|
|
</div><div class="data">
|
|
|
|
|
{{stateObj.attributes.next_rising | HATimeStripDate}}
|
|
|
|
@@ -78,12 +79,20 @@ if(this.removeAttribute(a),d)return j(this,a,c);var e=c,f=m(this,a,e);return j(t
|
|
|
|
|
Setting {{stateObj.attributes.next_setting | relativeHATime}}
|
|
|
|
|
</div><div class="data">
|
|
|
|
|
{{stateObj.attributes.next_setting | HATimeStripDate}}
|
|
|
|
|
</div></div></div></template><script>Polymer("more-info-sun",{stateObjChanged:function(){var rising=ha.util.parseTime(this.stateObj.attributes.next_rising);var setting=ha.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="more-info-content" attributes="api stateObj" assetpath="polymer/more-infos/"><template><style>:host{display:block}</style><div id="moreInfo" class="{{classNames}}"></div></template><script>Polymer("more-info-content",{classNames:"",observe:{"stateObj.attributes":"stateAttributesChanged"},stateObjChanged:function(){while(this.$.moreInfo.lastChild){this.$.moreInfo.removeChild(this.$.moreInfo.lastChild)}var moreInfo=document.createElement("more-info-"+this.stateObj.moreInfoType);moreInfo.api=this.api;moreInfo.stateObj=this.stateObj;this.$.moreInfo.appendChild(moreInfo)},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" attributes="api" assetpath="polymer/dialogs/"><template><ha-action-dialog id="dialog"><style>.title-card{margin-bottom:24px}</style><div><state-card-content stateobj="{{stateObj}}" api="{{api}}" class="title-card"></state-card-content><more-info-content stateobj="{{stateObj}}" api="{{api}}"></more-info-content></div><paper-button dismissive="" on-click="{{editClicked}}">Debug</paper-button><paper-button affirmative="">Dismiss</paper-button></ha-action-dialog></template><script>Polymer("more-info-dialog",{stateObj:{},show:function(stateObj){this.stateObj=stateObj;this.job("showDialogAfterRender",function(){this.$.dialog.toggle()}.bind(this))},editClicked:function(ev){this.api.showEditStateDialog(this.stateObj.entity_id)}});</script></polymer-element><script>var ha={};ha.util={};ha.util.parseTime=function(timeString){return moment(timeString,"HH:mm:ss DD-MM-YYYY")};ha.util.relativeTime=function(timeString){return ha.util.parseTime(timeString).fromNow()};PolymerExpressions.prototype.relativeHATime=function(timeString){return ha.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><event-fire-dialog id="eventDialog" api="{{api}}"></event-fire-dialog><service-call-dialog id="serviceDialog" api="{{api}}"></service-call-dialog><state-set-dialog id="stateSetDialog" api="{{api}}"></state-set-dialog><more-info-dialog id="moreInfoDialog" api="{{api}}"></more-info-dialog></template><script>var domainsWithCard=["thermostat"];var domainsWithMoreInfo=["light","group","sun"];State=function(json,api){this.api=api;this.attributes=json.attributes;this.entity_id=json.entity_id;var parts=json.entity_id.split(".");this.domain=parts[0];this.object_id=parts[1];if(this.attributes.friendly_name){this.entityDisplay=this.attributes.friendly_name}else{this.entityDisplay=this.object_id.replace(/_/g," ")}this.state=json.state;this.last_changed=json.last_changed};Object.defineProperties(State.prototype,{stateDisplay:{get:function(){var state=this.state.replace(/_/g," ");if(this.attributes.unit_of_measurement){return state+" "+this.attributes.unit_of_measurement}else{return state}}},isCustomGroup:{get:function(){return this.domain=="group"&&!this.attributes.auto}},canToggle:{get:function(){return this.domain=="group"&&(this.state=="on"||this.state=="off")||this.api.hasService(this.domain,"turn_on")}},cardType:{get:function(){if(domainsWithCard.indexOf(this.domain)!==-1){return this.domain}else if(this.canToggle){return"toggle"}else{return"display"}}},moreInfoType:{get:function(){if(domainsWithMoreInfo.indexOf(this.domain)!==-1){return this.domain}else{return"default"}}},relativeLastChanged:{get:function(){return ha.util.relativeTime(this.last_changed)}}});Polymer("home-assistant-api",{auth:"not-set",states:[],services:[],events:[],stateUpdateTimeout:null,created:function(){this.api=this;this.turn_on=this.turn_on.bind(this);this.turn_off=this.turn_off.bind(this)},getState:function(entityId){var found=this.states.filter(function(state){return state.entity_id==entityId},this);return found.length>0?found[0]:null},getStates:function(entityIds){var states=[];var state;for(var i=0;i<entityIds.length;i++){state=this.getState(entityIds[i]);if(state!==null){states.push(state)}}return states},hasService:function(domain,service){var found=this.services.filter(function(serv){return serv.domain==domain&&serv.services.indexOf(service)!==-1},this);return found.length>0},getCustomGroups:function(){return this.states.filter(function(state){return state.isCustomGroup})},_laterFetchStates:function(){if(this.stateUpdateTimeout){clearTimeout(this.stateUpdateTimeout)}this.stateLine truncated
|
|
|
|
|
</div></div></div></template><script>Polymer("more-info-sun",{stateObjChanged:function(){var rising=ha.util.parseTime(this.stateObj.attributes.next_rising);var setting=ha.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="more-info-content" attributes="api stateObj" assetpath="polymer/more-infos/"><template><style>:host{display:block}</style><div id="moreInfo" class="{{classNames}}"></div></template><script>Polymer("more-info-content",{classNames:"",observe:{"stateObj.attributes":"stateAttributesChanged"},stateObjChanged:function(){while(this.$.moreInfo.lastChild){this.$.moreInfo.removeChild(this.$.moreInfo.lastChild)}var moreInfo=document.createElement("more-info-"+this.stateObj.moreInfoType);moreInfo.api=this.api;moreInfo.stateObj=this.stateObj;this.$.moreInfo.appendChild(moreInfo)},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" attributes="api" assetpath="polymer/dialogs/"><template><ha-action-dialog id="dialog"><style>.title-card{margin-bottom:24px}</style><div><state-card-content stateobj="{{stateObj}}" api="{{api}}" class="title-card"></state-card-content><more-info-content stateobj="{{stateObj}}" api="{{api}}"></more-info-content></div><paper-button dismissive="" on-click="{{editClicked}}">Debug</paper-button><paper-button affirmative="">Dismiss</paper-button></ha-action-dialog></template><script>Polymer("more-info-dialog",{stateObj:{},observe:{"stateObj.attributes":"reposition"},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))},editClicked:function(ev){this.api.showEditStateDialog(this.stateObj.entity_id)}});</script></polymer-element><script>var ha={};ha.util={};ha.util.parseTime=function(timeString){return moment(timeString,"HH:mm:ss DD-MM-YYYY")};ha.util.relativeTime=function(timeString){return ha.util.parseTime(timeString).fromNow()};PolymerExpressions.prototype.relativeHATime=function(timeString){return ha.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><event-fire-dialog id="eventDialog" api="{{api}}"></event-fire-dialog><service-call-dialog id="serviceDialog" api="{{api}}"></service-call-dialog><state-set-dialog id="stateSetDialog" api="{{api}}"></state-set-dialog><more-info-dialog id="moreInfoDialog" api="{{api}}"></more-info-dialog></template><script>var domainsWithCard=["thermostat"];var domainsWithMoreInfo=["light","group","sun"];State=function(json,api){this.api=api;this.attributes=json.attributes;this.entity_id=json.entity_id;var parts=json.entity_id.split(".");this.domain=parts[0];this.object_id=parts[1];if(this.attributes.friendly_name){this.entityDisplay=this.attributes.friendly_name}else{this.entityDisplay=this.object_id.replace(/_/g," ")}this.state=json.state;this.last_changed=json.last_changed};Object.defineProperties(State.prototype,{stateDisplay:{get:function(){var state=this.state.replace(/_/g," ");if(this.attributes.unit_of_measurement){return state+" "+this.attributes.unit_of_measurement}else{return state}}},isCustomGroup:{get:function(){return this.domain=="group"&&!this.attributes.auto}},canToggle:{get:function(){return this.domain=="group"&&(this.state=="on"||this.state=="off")||this.api.hasService(this.domain,"turn_on")}},cardType:{get:function(){if(domainsWithCard.indexOf(this.domain)!==-1){return this.domain}else if(this.canToggle){return"toggle"}else{return"display"}}},moreInfoType:{get:function(){if(domainsWithMoreInfo.indexOf(this.domain)!==-1){return this.domain}else{return"default"}}},relativeLastChanged:{get:function(){return ha.util.relativeTime(this.last_changed)}}});Polymer("home-assistant-api",{auth:"not-set",states:[],services:[],events:[],stateUpdateTimeout:null,created:function(){this.api=this;this.turn_on=this.turn_on.bind(this);this.turn_off=this.turn_off.bind(this)},getState:function(entityId){var found=this.states.filter(function(state){return state.entity_id==entityId},this);return found.length>0?found[0]:null},getStates:function(entityIds){var states=[];var state;for(var i=0;i<entityIds.length;i++){state=this.getState(entityIds[i]);if(state!==null){states.push(state)}}return states},hasService:function(domain,service){var found=this.services.filter(function(serv){return serv.domain==domain&&serv.services.indexOf(service)!==-1},this);return found.length>0},getCLine truncated
|
|
|
|
|
<div hidden><polymer-element name="home-assistant-style" assetpath="polymer/resources/"><template><core-style id="ha-dialog">
|
|
|
|
|
:host {
|
|
|
|
|
font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
|
|
|
|
|
|
|
|
|
|
min-width: 350px;
|
|
|
|
|
max-width: 700px;
|
|
|
|
|
|
|
|
|
|
/* First two are from core-transition-bottom */
|
|
|
|
|
transition:
|
|
|
|
|
transform 0.2s ease-in-out,
|
|
|
|
|
opacity 0.2s ease-in,
|
|
|
|
|
top .3s,
|
|
|
|
|
left .3s !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:host .sidebar {
|
|
|
|
|