Remove path whitelisting for hassio (#7399)

* Remove path whitelisting for hassio

* Update frontend

* Lint
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2017-05-02 00:27:50 -07:00
1 parent 8ea6c7319a
commit f17c1090e1
14 files changed
+19 -302

No files matched your search

+4 -4
View File
@@ -3,20 +3,20 @@
FINGERPRINTS = {
"compatibility.js": "83d9c77748dafa9db49ae77d7f3d8fb0",
"core.js": "5d08475f03adb5969bd31855d5ca0cfd",
"frontend.html": "1533f44c55927e814294de757cd7eada",
"frontend.html": "094c2015c8291c767b8933428d92076f",
"mdi.html": "1cc8593d3684f7f6f3b3854403216f77",
"micromarkdown-js.html": "93b5ec4016f0bba585521cf4d18dec1a",
"panels/ha-panel-config.html": "39f00f769faa63ee61f1fe6fc85d67f7",
"panels/ha-panel-config.html": "59d9eb28758b497a4d9b2428f978b9b1",
"panels/ha-panel-dev-event.html": "2db9c218065ef0f61d8d08db8093cad2",
"panels/ha-panel-dev-info.html": "61610e015a411cfc84edd2c4d489e71d",
"panels/ha-panel-dev-service.html": "415552027cb083badeff5f16080410ed",
"panels/ha-panel-dev-state.html": "d70314913b8923d750932367b1099750",
"panels/ha-panel-dev-template.html": "567fbf86735e1b891e40c2f4060fec9b",
"panels/ha-panel-hassio.html": "1d954cfe5f47c4be3cf4f6f5db9a83b2",
"panels/ha-panel-hassio.html": "0aa1523357326cb40e2242dce9b2c0d6",
"panels/ha-panel-history.html": "89062c48c76206cad1cec14ddbb1cbb1",
"panels/ha-panel-iframe.html": "d920f0aa3c903680f2f8795e2255daab",
"panels/ha-panel-logbook.html": "6dd6a16f52117318b202e60f98400163",
"panels/ha-panel-map.html": "31c592c239636f91e07c7ac232a5ebc4",
"panels/ha-panel-zwave.html": "a81f82b48439da80286798558f414a2e",
"panels/ha-panel-zwave.html": "84fb45638d2a69bac343246a687f647c",
"websocket_test.html": "575de64b431fe11c3785bf96d7813450"
}
@@ -743,4 +743,4 @@ return performance.now()};else var t=function(){return Date.now()};var e=functio
this.hass.callService('media_player', service, serviceData);
},
});
}());</script><dom-module id="ha-media_player-card" assetpath="cards/"><template><style include="paper-material iron-flex iron-flex-alignment iron-positioning">:host{display:block;position:relative;font-size:0;border-radius:2px;overflow:hidden}.banner{position:relative;background-color:#fff;border-top-left-radius:2px;border-top-right-radius:2px}.banner:before{display:block;content:"";width:100%;padding-top:56%;transition:padding-top .8s}.banner.no-cover{background-position:center center;background-image:url(/static/images/card_media_player_bg.png);background-repeat:no-repeat;background-color:var(--primary-color)}.banner.content-type-music:before{padding-top:100%}.banner.no-cover:before{padding-top:88px}.banner>.cover{position:absolute;top:0;left:0;right:0;bottom:0;border-top-left-radius:2px;border-top-right-radius:2px;background-position:center center;background-size:cover;transition:opacity .8s;opacity:1}.banner.is-off>.cover{opacity:0}.banner>.caption{@apply(--paper-font-caption);position:absolute;left:0;right:0;bottom:0;background-color:rgba(0,0,0,var(--dark-secondary-opacity));padding:8px 16px;font-size:14px;font-weight:500;color:#fff;transition:background-color .5s}.banner.is-off>.caption{background-color:initial}.banner>.caption .title{@apply(--paper-font-common-nowrap);font-size:1.2em;margin:8px 0 4px}.progress{width:100%;--paper-progress-active-color:var(--accent-color);--paper-progress-container-color:#FFF}.controls{position:relative;@apply(--paper-font-body1);padding:8px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;background-color:#fff}.controls paper-icon-button{width:44px;height:44px}paper-icon-button{opacity:var(--dark-primary-opacity)}paper-icon-button[disabled]{opacity:var(--dark-disabled-opacity)}paper-icon-button.primary{width:56px!important;height:56px!important;background-color:var(--primary-color);color:#fff;border-radius:50%;padding:8px;transition:background-color .5s}paper-icon-button.primary[disabled]{background-color:rgba(0,0,0,var(--dark-disabled-opacity))}[invisible]{visibility:hidden!important}</style><div class$="[[computeBannerClasses(playerObj)]]"><div class="cover" id="cover"></div><div class="caption">[[computeStateName(stateObj)]]<div class="title">[[playerObj.primaryText]]</div>[[playerObj.secondaryText]]<br></div></div><paper-progress max="[[stateObj.attributes.media_duration]]" value="[[playbackPosition]]" hidden$="[[computeHideProgress(playerObj)]]" class="progress"></paper-progress><div class="controls layout horizontal justified"><paper-icon-button icon="mdi:power" on-tap="handleTogglePower" invisible$="[[computeHidePowerButton(playerObj)]]" class="self-center secondary"></paper-icon-button><div><paper-icon-button icon="mdi:skip-previous" invisible$="[[!playerObj.supportsPreviousTrack]]" disabled="[[playerObj.isOff]]" on-tap="handlePrevious"></paper-icon-button><paper-icon-button class="primary" icon="[[computePlaybackControlIcon(playerObj)]]" invisible$="[[!computePlaybackControlIcon(playerObj)]]" disabled="[[playerObj.isOff]]" on-tap="handlePlaybackControl"></paper-icon-button><paper-icon-button icon="mdi:skip-next" invisible$="[[!playerObj.supportsNextTrack]]" disabled="[[playerObj.isOff]]" on-tap="handleNext"></paper-icon-button></div><paper-icon-button icon="mdi:dots-vertical" on-tap="handleOpenMoreInfo" class="self-center secondary"></paper-icon-button></div></template></dom-module><script>Polymer({is:"ha-media_player-card",properties:{hass:{type:Object},stateObj:{type:Object},playerObj:{type:Object,computed:"computePlayerObj(hass, stateObj)",observer:"playerObjChanged"},playbackControlIcon:{type:String,computed:"computePlaybackControlIcon(playerObj)"},playbackPosition:{type:Number},elevation:{type:Number,value:1,reflectToAttribute:!0}},created:function(){this.updatePlaybackPosition=this.updatePlaybackPosition.bind(this)},playerObjChanged:function(t){var e,o=t.stateObj.attributes.entity_picture;o?(e=document.createElement("IMG"),e.onload=function(){this.$.cover.style.backgroundImage="url("+o+")",e.onerror=e.onload=null,e.src="",e=null}.bind(this),e.onerror=function(){this.$.cover.style.backgroundImage="",this.toggleClass("no-cover",!0,this.$.cover.parentElement),e.onerror=e.onload=null,e.src="",e=null}.bind(this),this._timeout_id&&clearTimeout(this._timeout_id),this._timeout_id=setTimeout(function(){e&&(this.$.cover.style.backgroundImage=""),this._timeout_id=null},5e3),e.src=o):this.$.cover.style.backgroundImage="",t.isPlaying?(this._positionTracking||(this._positionTracking=setInterval(this.updatePlaybackPosition,1e3)),this.updatePlaybackPosition()):this._positionTracking&&(clearInterval(this._positionTracking),this._positionTracking=null,this.playbackPosition=0)},updatePlaybackPosition:function(){this.playbackPosition=this.playerObj.currentProgress},computeBannerClasses:function(t){var e="banner";return t.isOff||t.isIdle?e+=" is-off no-cover":t.stateObj.attributes.entity_picture?"music"===t.stateObj.attributes.media_content_type&&(e+=" contentLine truncated
}());</script><dom-module id="ha-media_player-card" assetpath="cards/"><template><style include="paper-material iron-flex iron-flex-alignment iron-positioning">:host{display:block;position:relative;font-size:0;border-radius:2px;overflow:hidden}.banner{position:relative;background-color:#fff;border-top-left-radius:2px;border-top-right-radius:2px}.banner:before{display:block;content:"";width:100%;padding-top:56%;transition:padding-top .8s}.banner.no-cover{background-position:center center;background-image:url(/static/images/card_media_player_bg.png);background-repeat:no-repeat;background-color:var(--primary-color)}.banner.content-type-music:before{padding-top:100%}.banner.no-cover:before{padding-top:88px}.banner>.cover{position:absolute;top:0;left:0;right:0;bottom:0;border-top-left-radius:2px;border-top-right-radius:2px;background-position:center center;background-size:cover;transition:opacity .8s;opacity:1}.banner.is-off>.cover{opacity:0}.banner>.caption{@apply(--paper-font-caption);position:absolute;left:0;right:0;bottom:0;background-color:rgba(0,0,0,var(--dark-secondary-opacity));padding:8px 16px;font-size:14px;font-weight:500;color:#fff;transition:background-color .5s}.banner.is-off>.caption{background-color:initial}.banner>.caption .title{@apply(--paper-font-common-nowrap);font-size:1.2em;margin:8px 0 4px}.progress{width:100%;--paper-progress-active-color:var(--accent-color);--paper-progress-container-color:#FFF}.controls{position:relative;@apply(--paper-font-body1);padding:8px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;background-color:#fff}.controls paper-icon-button{width:44px;height:44px}paper-icon-button{opacity:var(--dark-primary-opacity)}paper-icon-button[disabled]{opacity:var(--dark-disabled-opacity)}paper-icon-button.primary{width:56px!important;height:56px!important;background-color:var(--primary-color);color:#fff;border-radius:50%;padding:8px;transition:background-color .5s}paper-icon-button.primary[disabled]{background-color:rgba(0,0,0,var(--dark-disabled-opacity))}[invisible]{visibility:hidden!important}</style><div class$="[[computeBannerClasses(playerObj)]]"><div class="cover" id="cover"></div><div class="caption">[[computeStateName(stateObj)]]<div class="title">[[playerObj.primaryText]]</div>[[playerObj.secondaryText]]<br></div></div><paper-progress max="[[stateObj.attributes.media_duration]]" value="[[playbackPosition]]" hidden$="[[computeHideProgress(playerObj)]]" class="progress"></paper-progress><div class="controls layout horizontal justified"><paper-icon-button icon="mdi:power" on-tap="handleTogglePower" invisible$="[[computeHidePowerButton(playerObj)]]" class="self-center secondary"></paper-icon-button><div><paper-icon-button icon="mdi:skip-previous" invisible$="[[!playerObj.supportsPreviousTrack]]" disabled="[[playerObj.isOff]]" on-tap="handlePrevious"></paper-icon-button><paper-icon-button class="primary" icon="[[computePlaybackControlIcon(playerObj)]]" invisible$="[[!computePlaybackControlIcon(playerObj)]]" disabled="[[playerObj.isOff]]" on-tap="handlePlaybackControl"></paper-icon-button><paper-icon-button icon="mdi:skip-next" invisible$="[[!playerObj.supportsNextTrack]]" disabled="[[playerObj.isOff]]" on-tap="handleNext"></paper-icon-button></div><paper-icon-button icon="mdi:dots-vertical" on-tap="handleOpenMoreInfo" class="self-center secondary"></paper-icon-button></div></template></dom-module><script>Polymer({is:"ha-media_player-card",properties:{hass:{type:Object},stateObj:{type:Object},playerObj:{type:Object,computed:"computePlayerObj(hass, stateObj)",observer:"playerObjChanged"},playbackControlIcon:{type:String,computed:"computePlaybackControlIcon(playerObj)"},playbackPosition:{type:Number},elevation:{type:Number,value:1,reflectToAttribute:!0}},created:function(){this.updatePlaybackPosition=this.updatePlaybackPosition.bind(this)},playerObjChanged:function(t){var e,o=t.stateObj.attributes.entity_picture;o?(e=document.createElement("IMG"),e.onload=function(){this.$.cover.style.backgroundImage="url("+o+")",e.onerror=e.onload=null,e.src="",e=null}.bind(this),e.onerror=function(){this.$.cover.style.backgroundImage="",this.toggleClass("no-cover",!0,this.$.cover.parentElement),e.onerror=e.onload=null,e.src="",e=null}.bind(this),this._timeout_id&&clearTimeout(this._timeout_id),this._timeout_id=setTimeout(function(){e&&(this.$.cover.style.backgroundImage=""),this._timeout_id=null},5e3),e.src=o):this.$.cover.style.backgroundImage="",t.isPlaying?(this._positionTracking||(this._positionTracking=setInterval(this.updatePlaybackPosition,1e3)),this.updatePlaybackPosition()):this._positionTracking&&(clearInterval(this._positionTracking),this._positionTracking=null,this.playbackPosition=0)},updatePlaybackPosition:function(){this.playbackPosition=this.playerObj.currentProgress},computeBannerClasses:function(t){var e="banner";return t.isOff||t.isIdle?e+=" is-off no-cover":t.stateObj.attributes.entity_picture?"music"===t.stateObj.attributes.media_content_type&&(e+=" contentLine truncated
@@ -1,4 +1,4 @@
<html><head><meta charset="UTF-8"></head><body><div hidden="" by-vulcanize=""><dom-module id="iron-image" assetpath="../../bower_components/iron-image/"><template><style>:host{display:inline-block;overflow:hidden;position:relative}#sizedImgDiv{@apply(--layout-fit);display:none}#img{display:block;width:var(--iron-image-width,auto);height:var(--iron-image-height,auto)}:host([sizing]) #sizedImgDiv{display:block}:host([sizing]) #img{display:none}#placeholder{@apply(--layout-fit);background-color:inherit;opacity:1;@apply(--iron-image-placeholder)}#placeholder.faded-out{transition:opacity .5s linear;opacity:0}</style><div id="sizedImgDiv" role="img" hidden$="[[_computeImgDivHidden(sizing)]]" aria-hidden$="[[_computeImgDivARIAHidden(alt)]]" aria-label$="[[_computeImgDivARIALabel(alt, src)]]"></div><img id="img" alt$="[[alt]]" hidden$="[[_computeImgHidden(sizing)]]"><div id="placeholder" hidden$="[[_computePlaceholderHidden(preload, fade, loading, loaded)]]" class$="[[_computePlaceholderClassName(preload, fade, loading, loaded)]]"></div></template><script>Polymer({is:"iron-image",properties:{src:{observer:"_srcChanged",type:String,value:""},alt:{type:String,value:null},preventLoad:{type:Boolean,value:!1,observer:"_preventLoadChanged"},sizing:{type:String,value:null,reflectToAttribute:!0},position:{type:String,value:"center"},preload:{type:Boolean,value:!1},placeholder:{type:String,value:null,observer:"_placeholderChanged"},fade:{type:Boolean,value:!1},loaded:{notify:!0,readOnly:!0,type:Boolean,value:!1},loading:{notify:!0,readOnly:!0,type:Boolean,value:!1},error:{notify:!0,readOnly:!0,type:Boolean,value:!1},width:{observer:"_widthChanged",type:Number,value:null},height:{observer:"_heightChanged",type:Number,value:null}},observers:["_transformChanged(sizing, position)"],ready:function(){var e=this.$.img;e.onload=function(){this.$.img.src===this._resolveSrc(this.src)&&(this._setLoading(!1),this._setLoaded(!0),this._setError(!1))}.bind(this),e.onerror=function(){this.$.img.src===this._resolveSrc(this.src)&&(this._reset(),this._setLoading(!1),this._setLoaded(!1),this._setError(!0))}.bind(this),this._resolvedSrc=""},_load:function(e){e?this.$.img.src=e:this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage=e?'url("'+e+'")':"",this._setLoading(!!e),this._setLoaded(!1),this._setError(!1)},_reset:function(){this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage="",this._setLoading(!1),this._setLoaded(!1),this._setError(!1)},_computePlaceholderHidden:function(){return!this.preload||!this.fade&&!this.loading&&this.loaded},_computePlaceholderClassName:function(){return this.preload&&this.fade&&!this.loading&&this.loaded?"faded-out":""},_computeImgDivHidden:function(){return!this.sizing},_computeImgDivARIAHidden:function(){return""===this.alt?"true":void 0},_computeImgDivARIALabel:function(){if(null!==this.alt)return this.alt;if(""===this.src)return"";var e=new URL(this._resolveSrc(this.src)).pathname.split("/");return e[e.length-1]},_computeImgHidden:function(){return!!this.sizing},_widthChanged:function(){this.style.width=isNaN(this.width)?this.width:this.width+"px"},_heightChanged:function(){this.style.height=isNaN(this.height)?this.height:this.height+"px"},_preventLoadChanged:function(){this.preventLoad||this.loaded||(this._reset(),this._load(this.src))},_srcChanged:function(e,t){var i=this._resolveSrc(e);i!==this._resolvedSrc&&(this._resolvedSrc=i,this._reset(),this.preventLoad||this._load(e))},_placeholderChanged:function(){this.$.placeholder.style.backgroundImage=this.placeholder?'url("'+this.placeholder+'")':""},_transformChanged:function(){var e=this.$.sizedImgDiv.style,t=this.$.placeholder.style;e.backgroundSize=t.backgroundSize=this.sizing,e.backgroundPosition=t.backgroundPosition=this.sizing?this.position:"",e.backgroundRepeat=t.backgroundRepeat=this.sizing?"no-repeat":""},_resolveSrc:function(e){var t=this.ownerDocument.baseURI;return new URL(Polymer.ResolveUrl.resolveUrl(e,t),t).href}})</script></dom-module><dom-module id="paper-card" assetpath="../../bower_components/paper-card/"><template><style include="paper-material">:host{display:inline-block;position:relative;box-sizing:border-box;background-color:var(--paper-card-background-color,--primary-background-color);border-radius:2px;@apply(--paper-font-common-base);@apply(--paper-card)}[hidden]{display:none!important}.header{position:relative;border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden;@apply(--paper-card-header)}.header iron-image{display:block;width:100%;--iron-image-width:100%;pointer-events:none;@apply(--paper-card-header-image)}.header .title-text{padding:16px;font-size:24px;font-weight:400;color:var(--paper-card-header-color,#000);@apply(--paper-card-header-text)}.header .title-text.over-image{position:absolute;bottom:0;@apply(--paper-card-header-image-text)}:host ::content .card-content{padding:16px;position:relative;@apply(--paper-card-content)}:host ::content .card-actions{borderLine truncated
<html><head><meta charset="UTF-8"></head><body><div hidden="" by-vulcanize=""><dom-module id="iron-image" assetpath="../../bower_components/iron-image/"><template><style>:host{display:inline-block;overflow:hidden;position:relative}#sizedImgDiv{@apply(--layout-fit);display:none}#img{display:block;width:var(--iron-image-width,auto);height:var(--iron-image-height,auto)}:host([sizing]) #sizedImgDiv{display:block}:host([sizing]) #img{display:none}#placeholder{@apply(--layout-fit);background-color:inherit;opacity:1;@apply(--iron-image-placeholder)}#placeholder.faded-out{transition:opacity .5s linear;opacity:0}</style><div id="sizedImgDiv" role="img" hidden$="[[_computeImgDivHidden(sizing)]]" aria-hidden$="[[_computeImgDivARIAHidden(alt)]]" aria-label$="[[_computeImgDivARIALabel(alt, src)]]"></div><img id="img" alt$="[[alt]]" hidden$="[[_computeImgHidden(sizing)]]"><div id="placeholder" hidden$="[[_computePlaceholderHidden(preload, fade, loading, loaded)]]" class$="[[_computePlaceholderClassName(preload, fade, loading, loaded)]]"></div></template><script>Polymer({is:"iron-image",properties:{src:{observer:"_srcChanged",type:String,value:""},alt:{type:String,value:null},preventLoad:{type:Boolean,value:!1,observer:"_preventLoadChanged"},sizing:{type:String,value:null,reflectToAttribute:!0},position:{type:String,value:"center"},preload:{type:Boolean,value:!1},placeholder:{type:String,value:null,observer:"_placeholderChanged"},fade:{type:Boolean,value:!1},loaded:{notify:!0,readOnly:!0,type:Boolean,value:!1},loading:{notify:!0,readOnly:!0,type:Boolean,value:!1},error:{notify:!0,readOnly:!0,type:Boolean,value:!1},width:{observer:"_widthChanged",type:Number,value:null},height:{observer:"_heightChanged",type:Number,value:null}},observers:["_transformChanged(sizing, position)"],ready:function(){var e=this.$.img;e.onload=function(){this.$.img.src===this._resolveSrc(this.src)&&(this._setLoading(!1),this._setLoaded(!0),this._setError(!1))}.bind(this),e.onerror=function(){this.$.img.src===this._resolveSrc(this.src)&&(this._reset(),this._setLoading(!1),this._setLoaded(!1),this._setError(!0))}.bind(this),this._resolvedSrc=""},_load:function(e){e?this.$.img.src=e:this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage=e?'url("'+e+'")':"",this._setLoading(!!e),this._setLoaded(!1),this._setError(!1)},_reset:function(){this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage="",this._setLoading(!1),this._setLoaded(!1),this._setError(!1)},_computePlaceholderHidden:function(){return!this.preload||!this.fade&&!this.loading&&this.loaded},_computePlaceholderClassName:function(){return this.preload&&this.fade&&!this.loading&&this.loaded?"faded-out":""},_computeImgDivHidden:function(){return!this.sizing},_computeImgDivARIAHidden:function(){return""===this.alt?"true":void 0},_computeImgDivARIALabel:function(){if(null!==this.alt)return this.alt;if(""===this.src)return"";var e=new URL(this._resolveSrc(this.src)).pathname.split("/");return e[e.length-1]},_computeImgHidden:function(){return!!this.sizing},_widthChanged:function(){this.style.width=isNaN(this.width)?this.width:this.width+"px"},_heightChanged:function(){this.style.height=isNaN(this.height)?this.height:this.height+"px"},_preventLoadChanged:function(){this.preventLoad||this.loaded||(this._reset(),this._load(this.src))},_srcChanged:function(e,t){var i=this._resolveSrc(e);i!==this._resolvedSrc&&(this._resolvedSrc=i,this._reset(),this.preventLoad||this._load(e))},_placeholderChanged:function(){this.$.placeholder.style.backgroundImage=this.placeholder?'url("'+this.placeholder+'")':""},_transformChanged:function(){var e=this.$.sizedImgDiv.style,t=this.$.placeholder.style;e.backgroundSize=t.backgroundSize=this.sizing,e.backgroundPosition=t.backgroundPosition=this.sizing?this.position:"",e.backgroundRepeat=t.backgroundRepeat=this.sizing?"no-repeat":""},_resolveSrc:function(e){var t=this.ownerDocument.baseURI;return new URL(Polymer.ResolveUrl.resolveUrl(e,t),t).href}})</script></dom-module><dom-module id="paper-card" assetpath="../../bower_components/paper-card/"><template><style include="paper-material">:host{display:inline-block;position:relative;box-sizing:border-box;background-color:var(--paper-card-background-color,--primary-background-color);border-radius:2px;@apply(--paper-font-common-base);@apply(--paper-card)}[hidden]{display:none!important}.header{position:relative;border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden;@apply(--paper-card-header)}.header iron-image{display:block;width:100%;--iron-image-width:100%;pointer-events:none;@apply(--paper-card-header-image)}.header .title-text{padding:16px;font-size:24px;font-weight:400;color:var(--paper-card-header-color,#000);@apply(--paper-card-header-text)}.header .title-text.over-image{position:absolute;bottom:0;@apply(--paper-card-header-image-text)}:host ::content .card-content{padding:16px;position:relative;@apply(--paper-card-content)}:host ::content .card-actions{borderLine truncated
is: 'ha-panel-config',
properties: {
@@ -1,184 +1,17 @@
<html><head><meta charset="UTF-8"></head><body><div hidden="" by-vulcanize=""><dom-module id="iron-image" assetpath="../../bower_components/iron-image/"><template><style>:host{display:inline-block;overflow:hidden;position:relative}#sizedImgDiv{@apply(--layout-fit);display:none}#img{display:block;width:var(--iron-image-width,auto);height:var(--iron-image-height,auto)}:host([sizing]) #sizedImgDiv{display:block}:host([sizing]) #img{display:none}#placeholder{@apply(--layout-fit);background-color:inherit;opacity:1;@apply(--iron-image-placeholder)}#placeholder.faded-out{transition:opacity .5s linear;opacity:0}</style><div id="sizedImgDiv" role="img" hidden$="[[_computeImgDivHidden(sizing)]]" aria-hidden$="[[_computeImgDivARIAHidden(alt)]]" aria-label$="[[_computeImgDivARIALabel(alt, src)]]"></div><img id="img" alt$="[[alt]]" hidden$="[[_computeImgHidden(sizing)]]"><div id="placeholder" hidden$="[[_computePlaceholderHidden(preload, fade, loading, loaded)]]" class$="[[_computePlaceholderClassName(preload, fade, loading, loaded)]]"></div></template><script>Polymer({is:"iron-image",properties:{src:{observer:"_srcChanged",type:String,value:""},alt:{type:String,value:null},preventLoad:{type:Boolean,value:!1,observer:"_preventLoadChanged"},sizing:{type:String,value:null,reflectToAttribute:!0},position:{type:String,value:"center"},preload:{type:Boolean,value:!1},placeholder:{type:String,value:null,observer:"_placeholderChanged"},fade:{type:Boolean,value:!1},loaded:{notify:!0,readOnly:!0,type:Boolean,value:!1},loading:{notify:!0,readOnly:!0,type:Boolean,value:!1},error:{notify:!0,readOnly:!0,type:Boolean,value:!1},width:{observer:"_widthChanged",type:Number,value:null},height:{observer:"_heightChanged",type:Number,value:null}},observers:["_transformChanged(sizing, position)"],ready:function(){var e=this.$.img;e.onload=function(){this.$.img.src===this._resolveSrc(this.src)&&(this._setLoading(!1),this._setLoaded(!0),this._setError(!1))}.bind(this),e.onerror=function(){this.$.img.src===this._resolveSrc(this.src)&&(this._reset(),this._setLoading(!1),this._setLoaded(!1),this._setError(!0))}.bind(this),this._resolvedSrc=""},_load:function(e){e?this.$.img.src=e:this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage=e?'url("'+e+'")':"",this._setLoading(!!e),this._setLoaded(!1),this._setError(!1)},_reset:function(){this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage="",this._setLoading(!1),this._setLoaded(!1),this._setError(!1)},_computePlaceholderHidden:function(){return!this.preload||!this.fade&&!this.loading&&this.loaded},_computePlaceholderClassName:function(){return this.preload&&this.fade&&!this.loading&&this.loaded?"faded-out":""},_computeImgDivHidden:function(){return!this.sizing},_computeImgDivARIAHidden:function(){return""===this.alt?"true":void 0},_computeImgDivARIALabel:function(){if(null!==this.alt)return this.alt;if(""===this.src)return"";var e=new URL(this._resolveSrc(this.src)).pathname.split("/");return e[e.length-1]},_computeImgHidden:function(){return!!this.sizing},_widthChanged:function(){this.style.width=isNaN(this.width)?this.width:this.width+"px"},_heightChanged:function(){this.style.height=isNaN(this.height)?this.height:this.height+"px"},_preventLoadChanged:function(){this.preventLoad||this.loaded||(this._reset(),this._load(this.src))},_srcChanged:function(e,t){var i=this._resolveSrc(e);i!==this._resolvedSrc&&(this._resolvedSrc=i,this._reset(),this.preventLoad||this._load(e))},_placeholderChanged:function(){this.$.placeholder.style.backgroundImage=this.placeholder?'url("'+this.placeholder+'")':""},_transformChanged:function(){var e=this.$.sizedImgDiv.style,t=this.$.placeholder.style;e.backgroundSize=t.backgroundSize=this.sizing,e.backgroundPosition=t.backgroundPosition=this.sizing?this.position:"",e.backgroundRepeat=t.backgroundRepeat=this.sizing?"no-repeat":""},_resolveSrc:function(e){var t=this.ownerDocument.baseURI;return new URL(Polymer.ResolveUrl.resolveUrl(e,t),t).href}})</script></dom-module><style is="custom-style">:root{--google-red-100:#f4c7c3;--google-red-300:#e67c73;--google-red-500:#db4437;--google-red-700:#c53929;--google-blue-100:#c6dafc;--google-blue-300:#7baaf7;--google-blue-500:#4285f4;--google-blue-700:#3367d6;--google-green-100:#b7e1cd;--google-green-300:#57bb8a;--google-green-500:#0f9d58;--google-green-700:#0b8043;--google-yellow-100:#fce8b2;--google-yellow-300:#f7cb4d;--google-yellow-500:#f4b400;--google-yellow-700:#f09300;--google-grey-100:#f5f5f5;--google-grey-300:#e0e0e0;--google-grey-500:#9e9e9e;--google-grey-700:#616161;--paper-red-50:#ffebee;--paper-red-100:#ffcdd2;--paper-red-200:#ef9a9a;--paper-red-300:#e57373;--paper-red-400:#ef5350;--paper-red-500:#f44336;--paper-red-600:#e53935;--paper-red-700:#d32f2f;--paper-red-800:#c62828;--paper-red-900:#b71c1c;--paper-red-a100:#ff8a80;--paper-red-a200:#ff5252;--paper-red-a400:#ff1744;--paper-red-a700:#d50000;--paper-pink-50:#fce4ec;--paper-pink-100:#f8bbd0;--paper-pink-200:#f48fb1;--paper-pinkLine truncated
is: 'hassio-addons',
<html><head><meta charset="UTF-8"></head><body><div hidden="" by-vulcanize=""><dom-module id="iron-image" assetpath="../../bower_components/iron-image/"><template><style>:host{display:inline-block;overflow:hidden;position:relative}#sizedImgDiv{@apply(--layout-fit);display:none}#img{display:block;width:var(--iron-image-width,auto);height:var(--iron-image-height,auto)}:host([sizing]) #sizedImgDiv{display:block}:host([sizing]) #img{display:none}#placeholder{@apply(--layout-fit);background-color:inherit;opacity:1;@apply(--iron-image-placeholder)}#placeholder.faded-out{transition:opacity .5s linear;opacity:0}</style><div id="sizedImgDiv" role="img" hidden$="[[_computeImgDivHidden(sizing)]]" aria-hidden$="[[_computeImgDivARIAHidden(alt)]]" aria-label$="[[_computeImgDivARIALabel(alt, src)]]"></div><img id="img" alt$="[[alt]]" hidden$="[[_computeImgHidden(sizing)]]"><div id="placeholder" hidden$="[[_computePlaceholderHidden(preload, fade, loading, loaded)]]" class$="[[_computePlaceholderClassName(preload, fade, loading, loaded)]]"></div></template><script>Polymer({is:"iron-image",properties:{src:{observer:"_srcChanged",type:String,value:""},alt:{type:String,value:null},preventLoad:{type:Boolean,value:!1,observer:"_preventLoadChanged"},sizing:{type:String,value:null,reflectToAttribute:!0},position:{type:String,value:"center"},preload:{type:Boolean,value:!1},placeholder:{type:String,value:null,observer:"_placeholderChanged"},fade:{type:Boolean,value:!1},loaded:{notify:!0,readOnly:!0,type:Boolean,value:!1},loading:{notify:!0,readOnly:!0,type:Boolean,value:!1},error:{notify:!0,readOnly:!0,type:Boolean,value:!1},width:{observer:"_widthChanged",type:Number,value:null},height:{observer:"_heightChanged",type:Number,value:null}},observers:["_transformChanged(sizing, position)"],ready:function(){var e=this.$.img;e.onload=function(){this.$.img.src===this._resolveSrc(this.src)&&(this._setLoading(!1),this._setLoaded(!0),this._setError(!1))}.bind(this),e.onerror=function(){this.$.img.src===this._resolveSrc(this.src)&&(this._reset(),this._setLoading(!1),this._setLoaded(!1),this._setError(!0))}.bind(this),this._resolvedSrc=""},_load:function(e){e?this.$.img.src=e:this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage=e?'url("'+e+'")':"",this._setLoading(!!e),this._setLoaded(!1),this._setError(!1)},_reset:function(){this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage="",this._setLoading(!1),this._setLoaded(!1),this._setError(!1)},_computePlaceholderHidden:function(){return!this.preload||!this.fade&&!this.loading&&this.loaded},_computePlaceholderClassName:function(){return this.preload&&this.fade&&!this.loading&&this.loaded?"faded-out":""},_computeImgDivHidden:function(){return!this.sizing},_computeImgDivARIAHidden:function(){return""===this.alt?"true":void 0},_computeImgDivARIALabel:function(){if(null!==this.alt)return this.alt;if(""===this.src)return"";var e=new URL(this._resolveSrc(this.src)).pathname.split("/");return e[e.length-1]},_computeImgHidden:function(){return!!this.sizing},_widthChanged:function(){this.style.width=isNaN(this.width)?this.width:this.width+"px"},_heightChanged:function(){this.style.height=isNaN(this.height)?this.height:this.height+"px"},_preventLoadChanged:function(){this.preventLoad||this.loaded||(this._reset(),this._load(this.src))},_srcChanged:function(e,t){var i=this._resolveSrc(e);i!==this._resolvedSrc&&(this._resolvedSrc=i,this._reset(),this.preventLoad||this._load(e))},_placeholderChanged:function(){this.$.placeholder.style.backgroundImage=this.placeholder?'url("'+this.placeholder+'")':""},_transformChanged:function(){var e=this.$.sizedImgDiv.style,t=this.$.placeholder.style;e.backgroundSize=t.backgroundSize=this.sizing,e.backgroundPosition=t.backgroundPosition=this.sizing?this.position:"",e.backgroundRepeat=t.backgroundRepeat=this.sizing?"no-repeat":""},_resolveSrc:function(e){var t=this.ownerDocument.baseURI;return new URL(Polymer.ResolveUrl.resolveUrl(e,t),t).href}})</script></dom-module><dom-module id="paper-card" assetpath="../../bower_components/paper-card/"><template><style include="paper-material">:host{display:inline-block;position:relative;box-sizing:border-box;background-color:var(--paper-card-background-color,--primary-background-color);border-radius:2px;@apply(--paper-font-common-base);@apply(--paper-card)}[hidden]{display:none!important}.header{position:relative;border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden;@apply(--paper-card-header)}.header iron-image{display:block;width:100%;--iron-image-width:100%;pointer-events:none;@apply(--paper-card-header-image)}.header .title-text{padding:16px;font-size:24px;font-weight:400;color:var(--paper-card-header-color,#000);@apply(--paper-card-header-text)}.header .title-text.over-image{position:absolute;bottom:0;@apply(--paper-card-header-image-text)}:host ::content .card-content{padding:16px;position:relative;@apply(--paper-card-content)}:host ::content .card-actions{borderLine truncated
is: 'hassio-addon-info',
properties: {
hass: {
type: Object,
},
narrow: {
type: Boolean,
},
showMenu: {
type: Boolean,
value: false,
},
data: {
type: Object,
value: [],
},
},
computeInstallStatus(addon) {
return addon.installed || 'Not installed';
},
addonTapped: function (ev) {
this.fire('hassio-select-addon', { addon: this.data[ev.model.index].slug });
ev.target.blur();
},
});</script><dom-module id="hassio-dashboard" assetpath="./"><template><style include="iron-flex ha-style">.content{padding:24px 0 32px;max-width:600px;margin:0 auto}.status{@apply(--layout-horizontal);margin-bottom:24px}.status>*{@apply(--layout-flex)}.status>:first-child{margin-right:24px}</style><app-header-layout has-scrolling-region=""><app-header fixed=""><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">Hass.io</div></app-toolbar></app-header><div class="content"><div class="status"><hassio-supervisor-info hass="[[hass]]" data="[[supervisorInfo]]"></hassio-supervisor-info><hassio-host-info hass="[[hass]]" data="[[hostInfo]]"></hassio-host-info></div><div class="status"><hassio-hass-info hass="[[hass]]" data="[[hassInfo]]"></hassio-hass-info><div></div></div><hassio-addons hass="[[hass]]" data="[[supervisorInfo.addons]]"></hassio-addons></div></app-header-layout></template></dom-module><script>Polymer({is:"hassio-dashboard",properties:{hass:{type:Object},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},supervisorInfo:{type:Object,value:{}},hostInfo:{type:Object,value:{}},hassInfo:{type:Object,value:{}}}})</script><script>Polymer.IronValidatableBehaviorMeta=null,Polymer.IronValidatableBehavior={properties:{validator:{type:String},invalid:{notify:!0,reflectToAttribute:!0,type:Boolean,value:!1},_validatorMeta:{type:Object},validatorType:{type:String,value:"validator"},_validator:{type:Object,computed:"__computeValidator(validator)"}},observers:["_invalidChanged(invalid)"],registered:function(){Polymer.IronValidatableBehaviorMeta=new Polymer.IronMeta({type:"validator"})},_invalidChanged:function(){this.invalid?this.setAttribute("aria-invalid","true"):this.removeAttribute("aria-invalid")},hasValidator:function(){return null!=this._validator},validate:function(a){return this.invalid=!this._getValidity(a),!this.invalid},_getValidity:function(a){return!this.hasValidator()||this._validator.validate(a)},__computeValidator:function(){return Polymer.IronValidatableBehaviorMeta&&Polymer.IronValidatableBehaviorMeta.byKey(this.validator)}}</script><script>Polymer.IronFormElementBehavior={properties:{name:{type:String},value:{notify:!0,type:String},required:{type:Boolean,value:!1},_parentForm:{type:Object}},attached:function(){this.fire("iron-form-element-register")},detached:function(){this._parentForm&&this._parentForm.fire("iron-form-element-unregister",{target:this})}}</script><dom-module id="iron-autogrow-textarea" assetpath="../../bower_components/iron-autogrow-textarea/"><template><style>:host{display:inline-block;position:relative;width:400px;border:1px solid;padding:2px;-moz-appearance:textarea;-webkit-appearance:textarea;overflow:hidden}.mirror-text{visibility:hidden;word-wrap:break-word}.fit{@apply(--layout-fit)}textarea{position:relative;outline:0;border:none;resize:none;background:inherit;color:inherit;width:100%;height:100%;font-size:inherit;font-family:inherit;line-height:inherit;text-align:inherit;@apply(--iron-autogrow-textarea)}::content textarea:invalid{box-shadow:none}textarea::-webkit-input-placeholder{@apply(--iron-autogrow-textarea-placeholder)}textarea:-moz-placeholder{@apply(--iron-autogrow-textarea-placeholder)}textarea::-moz-placeholder{@apply(--iron-autogrow-textarea-placeholder)}textarea:-ms-input-placeholder{@apply(--iron-autogrow-textarea-placeholder)}</style><div id="mirror" class="mirror-text" aria-hidden="true">&nbsp;</div><div class="textarea-container fit"><textarea id="textarea" name$="[[name]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" required$="[[required]]" disabled$="[[disabled]]" rows$="[[rows]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]"></textarea></div></template></dom-module><script>Polymer({is:"iron-autogrow-textarea",behaviors:[Polymer.IronFormElementBehavior,Polymer.IronValidatableBehavior,Polymer.IronControlState],properties:{bindValue:{observer:"_bindValueChanged",type:String},rows:{type:Number,value:1,observer:"_updateCached"},maxRows:{type:Number,value:0,observer:"_updateCached"},autocomplete:{type:String,value:"off"},autofocus:{type:Boolean,value:!1},inputmode:{type:String},placeholder:{type:String},readonly:{type:String},required:{type:Boolean},minlength:{type:Number},maxlength:{type:Number}},listeners:{input:"_onInput"},observers:["_onValueChanged(value)"],get textarea(){return this.$.textarea},get selectionStart(){return this.$.textarea.selectionStart},get selectionEnd(){return this.$.textarea.selectionEnd},set selectionStart(e){this.$.textarea.selectionStart=e},set selectionEnd(e){this.$.textarea.selectionEnd=e},attached:function(){navigator.userAgent.match(/iP(?:[oa]d|hone)/)&&(this.$.textarea.style.marginLeft="-3px")},validate:function(){if(!this.required&&""==this.value)return this.invalid=!1,!0;var e;return this.hasValidator()?e=Polymer.IronValidatableBehavior.validate.call(this,Line truncated
is: 'hassio-addon-view',
properties: {
hass: {
type: Object,
},
narrow: {
type: Boolean,
},
showMenu: {
type: Boolean,
value: false,
},
addon: {
type: String,
observer: 'addonChanged',
},
options: {
type: String,
value: '',
},
optionsParsed: {
type: Object,
computed: 'parseOptions(options)',
},
supervisorInfo: {
type: Object,
},
hostInfo: {
type: Object,
},
isRunning: {
type: Boolean,
computed: 'computeIsRunning(addonState)',
},
addonInfo: {
type: Object,
computed: 'computeAddonInfo(supervisorInfo, addon)',
},
addonState: {
type: Object,
value: null,
observer: 'addonStateChanged',
},
addonLogs: {
type: String,
value: '',
},
},
addonChanged: function (addon) {
if (!this.hass) {
setTimeout(function () { this.addonChanged(addon); }.bind(this), 0);
return;
}
this.hass.callApi('get', 'hassio/addons/' + addon + '/info')
.then(function (info) {
// Error if addon not installed.
if (info.result !== 'error') {
this.addonState = info.data;
}
}.bind(this));
this.refreshLogs();
},
refreshLogs: function () {
this.hass.callApi('get', 'hassio/addons/' + this.addon + '/logs')
.then(function (info) {
this.addonLogs = info;
}.bind(this));
},
addonStateChanged: function (addonState) {
this.options = addonState ? JSON.stringify(addonState.options, null, 2) : '';
},
computeAddonInfo: function (supervisorInfo, addon) {
if (!supervisorInfo) return null;
for (var i = 0; i < supervisorInfo.addons.length; i++) {
var addonInfo = supervisorInfo.addons[i];
if (addonInfo.slug === addon) return addonInfo;
}
return null;
},
computeIsRunning: function (addonState) {
return addonState && addonState.state === 'started';
},
computeInstallStatus(addon) {
return addon.installed || 'Not installed';
},
computeUpdateAvailable: function (data) {
return data.version !== data.last_version;
},
parseOptions: function (options) {
try {
return JSON.parse(options);
} catch (err) {
return null;
}
},
computeOptionsData: function (optionsParsed) {
return {
options: optionsParsed,
};
},
backTapped: function () {
this.fire('hassio-select-addon', { addon: null });
},
pathStart: function (addon) {
return 'hassio/addons/' + addon + '/start';
},
pathStop: function (addon) {
return 'hassio/addons/' + addon + '/stop';
},
pathInstall: function (addon) {
return 'hassio/addons/' + addon + '/install';
},
pathUninstall: function (addon) {
return 'hassio/addons/' + addon + '/uninstall';
},
pathUpdate: function (addon) {
return 'hassio/addons/' + addon + '/update';
},
pathOptions: function (addon) {
return 'hassio/addons/' + addon + '/options';
},
});</script><dom-module id="hassio-loading" assetpath="./"><template><style include="iron-flex ha-style">[hidden]{display:none!important}.placeholder{height:100%}.layout{height:calc(100% - 64px)}</style><div class="placeholder"><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">Hass.io</div></app-toolbar><div class="layout horizontal center-center"><paper-spinner active=""></paper-spinner></div></div></template></dom-module><script>Polymer({is:"hassio-loading",properties:{hass:{type:Object},narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1}}})</script></div><dom-module id="ha-panel-hassio"><style>iron-pages{height:100%}</style><template><hassio-data hass="[[hass]]" supervisor="{{supervisorInfo}}" homeassistant="{{hassInfo}}" host="{{hostInfo}}"></hassio-data><template is="dom-if" if="[[!loaded]]"><hassio-loading narrow="[[narrow]]" hass="[[hass]]" show-menu="[[showMenu]]"></hassio-loading></template><template is="dom-if" if="[[loaded]]" restamp=""><template is="dom-if" if="[[addon]]"><hassio-addon-view hass="[[hass]]" supervisor-info="[[supervisorInfo]]" host-info="[[hostInfo]]" addon="[[addon]]"></hassio-addon-view></template><template is="dom-if" if="[[!addon]]"><hassio-dashboard hass="[[hass]]" narrow="[[narrow]]" show-menu="[[showMenu]]" supervisor-info="{{supervisorInfo}}" host-info="{{hostInfo}}" hass-info="[[hassInfo]]"></hassio-dashboard></template></template></template></dom-module><script>Polymer({is:"ha-panel-hassio",properties:{hass:{type:Object},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},addon:{type:String,value:""},supervisorInfo:{type:Object,value:null},hostInfo:{type:Object,value:null},hassInfo:{type:Object,value:null},forceLoading:{type:Boolean,value:!1},loaded:{type:Boolean,computed:"computeIsLoaded(supervisorInfo, hostInfo, hassInfo, forceLoading)"}},listeners:{"hassio-select-addon":"addonSelected"},computeIsLoaded:function(e,o,n,t){return null!==e&&null!==o&&null!==n&&!t},addonSelected:function(e){this.forceLoading=!0,setTimeout(function(){this.addon=e.detail.addon,this.forceLoading=!1}.bind(this),0)}})</script></body></html>
});</script><dom-module id="hassio-addon-state" assetpath="addon-view/"><template><style include="ha-style">:host{display:block}paper-card{display:block}</style><paper-card heading="Installed"><template is="dom-if" if="[[!addonState]]"><div class="card-content"><div>Add-on is not installed.</div></div><div class="card-actions"><ha-call-api-button hass="[[hass]]" path="[[pathInstall(addon)]]">Install</ha-call-api-button></div></template><template is="dom-if" if="[[addonState]]"><div class="card-content"><table class="info"><tbody><tr><td>Version</td><td>[[addonState.version]]</td></tr><tr><td>State</td><td>[[addonState.state]]</td></tr><tr><td>Boot</td><td>[[addonState.boot]]</td></tr></tbody></table></div><div class="card-actions"><template is="dom-if" if="[[!isRunning]]"><ha-call-api-button hass="[[hass]]" path="[[pathStart(addon)]]">Start</ha-call-api-button></template><template is="dom-if" if="[[isRunning]]"><ha-call-api-button class="warning" hass="[[hass]]" path="[[pathStop(addon)]]">Stop</ha-call-api-button></template><template is="dom-if" if="[[computeUpdateAvailable(addonState)]]"><ha-call-api-button hass="[[hass]]" path="[[pathUpdate(addon)]]">Update</ha-call-api-button></template><ha-call-api-button class="warning" hass="[[hass]]" path="[[pathUninstall(addon)]]">Uninstall</ha-call-api-button></div></template></paper-card></template></dom-module><script>Polymer({is:"hassio-addon-state",properties:{hass:{type:Object},addon:{type:String},isRunning:{type:Boolean,computed:"computeIsRunning(addonState)"},addonInfo:{type:Object,value:null},addonState:{type:Object,value:null}},computeIsRunning:function(t){return t&&"started"===t.state},computeUpdateAvailable:function(t){return t&&t.version!==t.last_version},pathStart:function(t){return"hassio/addons/"+t+"/start"},pathStop:function(t){return"hassio/addons/"+t+"/stop"},pathInstall:function(t){return"hassio/addons/"+t+"/install"},pathUninstall:function(t){return"hassio/addons/"+t+"/uninstall"},pathUpdate:function(t){return"hassio/addons/"+t+"/update"}})</script><dom-module id="hassio-addon-options" assetpath="addon-view/"><template><style include="ha-style">:host{display:block}paper-card{display:block}iron-autogrow-textarea{width:100%}</style><paper-card heading="Options"><div class="card-content"><iron-autogrow-textarea value="{{options}}"></iron-autogrow-textarea></div><div class="card-actions"><ha-call-api-button hass="[[hass]]" disabled="[[!optionsParsed]]" data="[[computeOptionsData(optionsParsed)]]" path="[[pathOptions(addon)]]">Save</ha-call-api-button></div></paper-card></template></dom-module><script>Polymer({is:"hassio-addon-options",properties:{hass:{type:Object},addon:{type:String},options:{type:String,value:""},optionsParsed:{type:Object,computed:"parseOptions(options)"},addonState:{type:Object,value:null,observer:"addonStateChanged"}},addonStateChanged:function(t){this.options=t?JSON.stringify(t.options,null,2):""},parseOptions:function(t){try{return JSON.parse(t)}catch(t){return null}},computeOptionsData:function(t){return{options:t}},pathOptions:function(t){return"hassio/addons/"+t+"/options"}})</script><dom-module id="hassio-addon-logs" assetpath="addon-view/"><template><style include="iron-flex ha-style">:host,paper-card{display:block}</style><paper-card heading="Logs"><div class="card-content"><pre>[[addonLogs]]</pre></div><div class="card-actions"><paper-button on-tap="refresh">Refresh</paper-button></div></paper-card></template></dom-module><script>Polymer({is:"hassio-addon-logs",properties:{hass:{type:Object},addon:{type:String,observer:"addonChanged"},addonLogs:{type:String,value:""}},addonChanged:function(s){if(!this.hass)return void setTimeout(function(){this.addonChanged(s)}.bind(this),0);this.refresh()},refresh:function(){this.hass.callApi("get","hassio/addons/"+this.addon+"/logs").then(function(s){this.addonLogs=s}.bind(this))}})</script><dom-module id="hassio-addon-view" assetpath="addon-view/"><template><style include="iron-flex ha-style">paper-card{display:block}.controls paper-card,hassio-addon-options{margin-bottom:24px}.content{padding:24px 0 32px;max-width:600px;margin:0 auto}.status{@apply(--layout-horizontal);margin-bottom:24px}.status>*{@apply(--layout-flex)}.status>:first-child{margin-right:24px}</style><app-header-layout has-scrolling-region=""><app-header fixed=""><app-toolbar><paper-icon-button icon="mdi:arrow-left" on-tap="backTapped"></paper-icon-button><div main-title="">[[addonInfo.name]]</div></app-toolbar></app-header><div class="content"><div class="status"><hassio-addon-info hass="[[hass]]" addon-info="[[addonInfo]]"></hassio-addon-info><hassio-addon-state hass="[[hass]]" addon="[[addon]]" addon-info="[[addonInfo]]" addon-state="[[addonState]]"></hassio-addon-state></div><template is="dom-if" if="[[addonState]]"><div class="controls"><hassio-addon-options hass="[[hass]]" addon="[[addon]]" addon-state="[[addonState]]"></hassio-addon-options><hassio-addon-logs hass="[[hass]]" addon="[[addon]]"></hassio-addon-lLine truncated
@@ -1 +1 @@
<html><head><meta charset="UTF-8"></head><body><div hidden="" by-vulcanize=""><style>[hidden]{display:none!important}</style><style is="custom-style">:root{--layout:{display:-ms-flexbox;display:-webkit-flex;display:flex};--layout-inline:{display:-ms-inline-flexbox;display:-webkit-inline-flex;display:inline-flex};--layout-horizontal:{@apply(--layout);-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row};--layout-horizontal-reverse:{@apply(--layout);-ms-flex-direction:row-reverse;-webkit-flex-direction:row-reverse;flex-direction:row-reverse};--layout-vertical:{@apply(--layout);-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column};--layout-vertical-reverse:{@apply(--layout);-ms-flex-direction:column-reverse;-webkit-flex-direction:column-reverse;flex-direction:column-reverse};--layout-wrap:{-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap};--layout-no-wrap:{-ms-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;flex-wrap:nowrap};--layout-wrap-reverse:{-ms-flex-wrap:wrap-reverse;-webkit-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse};--layout-flex-auto:{-ms-flex:1 1 auto;-webkit-flex:1 1 auto;flex:1 1 auto};--layout-flex-none:{-ms-flex:none;-webkit-flex:none;flex:none};--layout-flex:{-ms-flex:1 1 .000000001px;-webkit-flex:1;flex:1;-webkit-flex-basis:.000000001px;flex-basis:.000000001px};--layout-flex-2:{-ms-flex:2;-webkit-flex:2;flex:2};--layout-flex-3:{-ms-flex:3;-webkit-flex:3;flex:3};--layout-flex-4:{-ms-flex:4;-webkit-flex:4;flex:4};--layout-flex-5:{-ms-flex:5;-webkit-flex:5;flex:5};--layout-flex-6:{-ms-flex:6;-webkit-flex:6;flex:6};--layout-flex-7:{-ms-flex:7;-webkit-flex:7;flex:7};--layout-flex-8:{-ms-flex:8;-webkit-flex:8;flex:8};--layout-flex-9:{-ms-flex:9;-webkit-flex:9;flex:9};--layout-flex-10:{-ms-flex:10;-webkit-flex:10;flex:10};--layout-flex-11:{-ms-flex:11;-webkit-flex:11;flex:11};--layout-flex-12:{-ms-flex:12;-webkit-flex:12;flex:12};--layout-start:{-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start};--layout-center:{-ms-flex-align:center;-webkit-align-items:center;align-items:center};--layout-end:{-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end};--layout-baseline:{-ms-flex-align:baseline;-webkit-align-items:baseline;align-items:baseline};--layout-start-justified:{-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start};--layout-center-justified:{-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center};--layout-end-justified:{-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end};--layout-around-justified:{-ms-flex-pack:distribute;-webkit-justify-content:space-around;justify-content:space-around};--layout-justified:{-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between};--layout-center-center:{@apply(--layout-center);@apply(--layout-center-justified)};--layout-self-start:{-ms-align-self:flex-start;-webkit-align-self:flex-start;align-self:flex-start};--layout-self-center:{-ms-align-self:center;-webkit-align-self:center;align-self:center};--layout-self-end:{-ms-align-self:flex-end;-webkit-align-self:flex-end;align-self:flex-end};--layout-self-stretch:{-ms-align-self:stretch;-webkit-align-self:stretch;align-self:stretch};--layout-self-baseline:{-ms-align-self:baseline;-webkit-align-self:baseline;align-self:baseline};--layout-start-aligned:{-ms-flex-line-pack:start;-ms-align-content:flex-start;-webkit-align-content:flex-start;align-content:flex-start};--layout-end-aligned:{-ms-flex-line-pack:end;-ms-align-content:flex-end;-webkit-align-content:flex-end;align-content:flex-end};--layout-center-aligned:{-ms-flex-line-pack:center;-ms-align-content:center;-webkit-align-content:center;align-content:center};--layout-between-aligned:{-ms-flex-line-pack:justify;-ms-align-content:space-between;-webkit-align-content:space-between;align-content:space-between};--layout-around-aligned:{-ms-flex-line-pack:distribute;-ms-align-content:space-around;-webkit-align-content:space-around;align-content:space-around};--layout-block:{display:block};--layout-invisible:{visibility:hidden!important};--layout-relative:{position:relative};--layout-fit:{position:absolute;top:0;right:0;bottom:0;left:0};--layout-scroll:{-webkit-overflow-scrolling:touch;overflow:auto};--layout-fullbleed:{margin:0;height:100vh};--layout-fixed-top:{position:fixed;top:0;left:0;right:0};--layout-fixed-right:{position:fixed;top:0;right:0;bottom:0};--layout-fixed-bottom:{position:fixed;right:0;bottom:0;left:0};--layout-fixed-left:{position:fixed;top:0;bottom:0;left:0};}</style><dom-module id="iron-image" assetpath="../../bower_components/iron-image/"><template><style>:host{display:inline-block;overflow:hidden;position:relative}#sizedImgDiv{@apply(--layout-fit);display:none}#img{display:block;width:var(--iron-image-width,auto);height:var(--iron-image-height,auto)}:host([sizing]) #sizedImgDiv{display:block}:host([sizing]) #img{display:none}#placeholder{@apply(--layout-fit);bLine truncated
<html><head><meta charset="UTF-8"></head><body><div hidden="" by-vulcanize=""><style>[hidden]{display:none!important}</style><style is="custom-style">:root{--layout:{display:-ms-flexbox;display:-webkit-flex;display:flex};--layout-inline:{display:-ms-inline-flexbox;display:-webkit-inline-flex;display:inline-flex};--layout-horizontal:{@apply(--layout);-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row};--layout-horizontal-reverse:{@apply(--layout);-ms-flex-direction:row-reverse;-webkit-flex-direction:row-reverse;flex-direction:row-reverse};--layout-vertical:{@apply(--layout);-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column};--layout-vertical-reverse:{@apply(--layout);-ms-flex-direction:column-reverse;-webkit-flex-direction:column-reverse;flex-direction:column-reverse};--layout-wrap:{-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap};--layout-no-wrap:{-ms-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;flex-wrap:nowrap};--layout-wrap-reverse:{-ms-flex-wrap:wrap-reverse;-webkit-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse};--layout-flex-auto:{-ms-flex:1 1 auto;-webkit-flex:1 1 auto;flex:1 1 auto};--layout-flex-none:{-ms-flex:none;-webkit-flex:none;flex:none};--layout-flex:{-ms-flex:1 1 .000000001px;-webkit-flex:1;flex:1;-webkit-flex-basis:.000000001px;flex-basis:.000000001px};--layout-flex-2:{-ms-flex:2;-webkit-flex:2;flex:2};--layout-flex-3:{-ms-flex:3;-webkit-flex:3;flex:3};--layout-flex-4:{-ms-flex:4;-webkit-flex:4;flex:4};--layout-flex-5:{-ms-flex:5;-webkit-flex:5;flex:5};--layout-flex-6:{-ms-flex:6;-webkit-flex:6;flex:6};--layout-flex-7:{-ms-flex:7;-webkit-flex:7;flex:7};--layout-flex-8:{-ms-flex:8;-webkit-flex:8;flex:8};--layout-flex-9:{-ms-flex:9;-webkit-flex:9;flex:9};--layout-flex-10:{-ms-flex:10;-webkit-flex:10;flex:10};--layout-flex-11:{-ms-flex:11;-webkit-flex:11;flex:11};--layout-flex-12:{-ms-flex:12;-webkit-flex:12;flex:12};--layout-start:{-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start};--layout-center:{-ms-flex-align:center;-webkit-align-items:center;align-items:center};--layout-end:{-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end};--layout-baseline:{-ms-flex-align:baseline;-webkit-align-items:baseline;align-items:baseline};--layout-start-justified:{-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start};--layout-center-justified:{-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center};--layout-end-justified:{-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end};--layout-around-justified:{-ms-flex-pack:distribute;-webkit-justify-content:space-around;justify-content:space-around};--layout-justified:{-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between};--layout-center-center:{@apply(--layout-center);@apply(--layout-center-justified)};--layout-self-start:{-ms-align-self:flex-start;-webkit-align-self:flex-start;align-self:flex-start};--layout-self-center:{-ms-align-self:center;-webkit-align-self:center;align-self:center};--layout-self-end:{-ms-align-self:flex-end;-webkit-align-self:flex-end;align-self:flex-end};--layout-self-stretch:{-ms-align-self:stretch;-webkit-align-self:stretch;align-self:stretch};--layout-self-baseline:{-ms-align-self:baseline;-webkit-align-self:baseline;align-self:baseline};--layout-start-aligned:{-ms-flex-line-pack:start;-ms-align-content:flex-start;-webkit-align-content:flex-start;align-content:flex-start};--layout-end-aligned:{-ms-flex-line-pack:end;-ms-align-content:flex-end;-webkit-align-content:flex-end;align-content:flex-end};--layout-center-aligned:{-ms-flex-line-pack:center;-ms-align-content:center;-webkit-align-content:center;align-content:center};--layout-between-aligned:{-ms-flex-line-pack:justify;-ms-align-content:space-between;-webkit-align-content:space-between;align-content:space-between};--layout-around-aligned:{-ms-flex-line-pack:distribute;-ms-align-content:space-around;-webkit-align-content:space-around;align-content:space-around};--layout-block:{display:block};--layout-invisible:{visibility:hidden!important};--layout-relative:{position:relative};--layout-fit:{position:absolute;top:0;right:0;bottom:0;left:0};--layout-scroll:{-webkit-overflow-scrolling:touch;overflow:auto};--layout-fullbleed:{margin:0;height:100vh};--layout-fixed-top:{position:fixed;top:0;left:0;right:0};--layout-fixed-right:{position:fixed;top:0;right:0;bottom:0};--layout-fixed-bottom:{position:fixed;right:0;bottom:0;left:0};--layout-fixed-left:{position:fixed;top:0;bottom:0;left:0};}</style><dom-module id="iron-image" assetpath="../../bower_components/iron-image/"><template><style>:host{display:inline-block;overflow:hidden;position:relative}#sizedImgDiv{@apply(--layout-fit);display:none}#img{display:block;width:var(--iron-image-width,auto);height:var(--iron-image-height,auto)}:host([sizing]) #sizedImgDiv{display:block}:host([sizing]) #img{display:none}#placeholder{@apply(--layout-fit);bLine truncated
@@ -1 +1 @@
"use strict";function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}function notificationEventCallback(e,t){firePushCallback({action:t.action,data:t.notification.data,tag:t.notification.tag,type:e},t.notification.data.jwt)}function firePushCallback(e,t){delete e.data.jwt,0===Object.keys(e.data).length&&e.data.constructor===Object&&delete e.data,fetch("/api/notify.html5/callback",{method:"POST",headers:new Headers({"Content-Type":"application/json",Authorization:"Bearer "+t}),body:JSON.stringify(e)})}var precacheConfig=[["/","39154f75cd31edbe1d4a249039273520"],["/frontend/panels/dev-event-2db9c218065ef0f61d8d08db8093cad2.html","b5b751e49b1bba55f633ae0d7a92677d"],["/frontend/panels/dev-info-61610e015a411cfc84edd2c4d489e71d.html","6568377ee31cbd78fedc003b317f7faf"],["/frontend/panels/dev-service-415552027cb083badeff5f16080410ed.html","a4b1ec9bfa5bc3529af7783ae56cb55c"],["/frontend/panels/dev-state-d70314913b8923d750932367b1099750.html","c61b5b1461959aac106400e122993e9e"],["/frontend/panels/dev-template-567fbf86735e1b891e40c2f4060fec9b.html","d2853ecf45de1dbadf49fe99a7424ef3"],["/frontend/panels/map-31c592c239636f91e07c7ac232a5ebc4.html","182580419ce2c935ae6ec65502b6db96"],["/static/compatibility-83d9c77748dafa9db49ae77d7f3d8fb0.js","5f05c83be2b028d577962f9625904806"],["/static/core-5d08475f03adb5969bd31855d5ca0cfd.js","1cd99ba798bfcff9768c9d2bb2f58a7c"],["/static/frontend-1533f44c55927e814294de757cd7eada.html","4a5d18075e9c90493b51531c3d13d343"],["/static/mdi-d86ee142ae2476f49384bfe866a2885e.html","1a47930d13e98b823c3b00a824449f04"],["static/fonts/roboto/Roboto-Bold.ttf","d329cc8b34667f114a95422aaad1b063"],["static/fonts/roboto/Roboto-Light.ttf","7b5fb88f12bec8143f00e21bc3222124"],["static/fonts/roboto/Roboto-Medium.ttf","fe13e4170719c2fc586501e777bde143"],["static/fonts/roboto/Roboto-Regular.ttf","ac3f799d5bbaf5196fab15ab8de8431c"],["static/icons/favicon-192x192.png","419903b8422586a7e28021bbe9011175"],["static/icons/favicon.ico","04235bda7843ec2fceb1cbe2bc696cf4"],["static/images/card_media_player_bg.png","a34281d1c1835d338a642e90930e61aa"],["static/webcomponents-lite.min.js","32b5a9b7ada86304bec6b43d3f2194f0"]],cacheName="sw-precache-v3--"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(e){return e.redirected?("body"in e?Promise.resolve(e.body):e.blob()).then(function(t){return new Response(t,{headers:e.headers,status:e.status,statusText:e.statusText})}):Promise.resolve(e)},createCacheKey=function(e,t,n,a){var c=new URL(e);return a&&c.pathname.match(a)||(c.search+=(c.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),c.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,t){var n=new URL(e);return n.search=n.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(e){return t.every(function(t){return!t.test(e[0])})}).map(function(e){return e.join("=")}).join("&"),n.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],a=new URL(t,self.location),c=createCacheKey(a,hashParamName,n,!1);return[a.toString(),c]}));self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(e){return setOfCachedUrls(e).then(function(t){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(n){if(!t.has(n)){var a=new Request(n,{credentials:"same-origin"});return fetch(a).then(function(t){if(!t.ok)throw new Error("Request for "+n+" returned a response with status "+t.status);return cleanResponse(t).then(function(t){return e.put(n,t)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var t=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(e){return e.keys().then(function(n){return Promise.all(n.map(function(n){if(!t.has(n.url))return e.delete(n)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(e){if("GET"===e.request.method){var t,n=stripIgnoredUrlParameters(e.request.url,ignoreUrlParametersMatching);t=urlsToCacheKeys.has(n);t||(n=addDirectoryIndex(n,"index.html"),t=urlsToCacheKeys.has(n));!t&&"navigate"===e.request.mode&&isPathWhitelisted(["^((?!(static|api|local|service_worker.js|manifest.json)).)*$"],e.request.url)&&(n=new URL("/",self.location).toString(),t=urlsToCacheKeys.has(n)),t&&e.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(t){return console.warn('Couldn\'t serve response for "%s" from cache: %O',e.request.url,t),fetcLine truncated
"use strict";function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}function notificationEventCallback(e,t){firePushCallback({action:t.action,data:t.notification.data,tag:t.notification.tag,type:e},t.notification.data.jwt)}function firePushCallback(e,t){delete e.data.jwt,0===Object.keys(e.data).length&&e.data.constructor===Object&&delete e.data,fetch("/api/notify.html5/callback",{method:"POST",headers:new Headers({"Content-Type":"application/json",Authorization:"Bearer "+t}),body:JSON.stringify(e)})}var precacheConfig=[["/","43b9f99469029c48e429731761b03abd"],["/frontend/panels/dev-event-2db9c218065ef0f61d8d08db8093cad2.html","b5b751e49b1bba55f633ae0d7a92677d"],["/frontend/panels/dev-info-61610e015a411cfc84edd2c4d489e71d.html","6568377ee31cbd78fedc003b317f7faf"],["/frontend/panels/dev-service-415552027cb083badeff5f16080410ed.html","a4b1ec9bfa5bc3529af7783ae56cb55c"],["/frontend/panels/dev-state-d70314913b8923d750932367b1099750.html","c61b5b1461959aac106400e122993e9e"],["/frontend/panels/dev-template-567fbf86735e1b891e40c2f4060fec9b.html","d2853ecf45de1dbadf49fe99a7424ef3"],["/frontend/panels/map-31c592c239636f91e07c7ac232a5ebc4.html","182580419ce2c935ae6ec65502b6db96"],["/static/compatibility-83d9c77748dafa9db49ae77d7f3d8fb0.js","5f05c83be2b028d577962f9625904806"],["/static/core-5d08475f03adb5969bd31855d5ca0cfd.js","1cd99ba798bfcff9768c9d2bb2f58a7c"],["/static/frontend-094c2015c8291c767b8933428d92076f.html","9f6ff2fa80d6e34106c533b941ad0141"],["/static/mdi-1cc8593d3684f7f6f3b3854403216f77.html","eac41ec8397af607a07bc174e3c2475f"],["static/fonts/roboto/Roboto-Bold.ttf","d329cc8b34667f114a95422aaad1b063"],["static/fonts/roboto/Roboto-Light.ttf","7b5fb88f12bec8143f00e21bc3222124"],["static/fonts/roboto/Roboto-Medium.ttf","fe13e4170719c2fc586501e777bde143"],["static/fonts/roboto/Roboto-Regular.ttf","ac3f799d5bbaf5196fab15ab8de8431c"],["static/icons/favicon-192x192.png","419903b8422586a7e28021bbe9011175"],["static/icons/favicon.ico","04235bda7843ec2fceb1cbe2bc696cf4"],["static/images/card_media_player_bg.png","a34281d1c1835d338a642e90930e61aa"],["static/webcomponents-lite.min.js","32b5a9b7ada86304bec6b43d3f2194f0"]],cacheName="sw-precache-v3--"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(e){return e.redirected?("body"in e?Promise.resolve(e.body):e.blob()).then(function(t){return new Response(t,{headers:e.headers,status:e.status,statusText:e.statusText})}):Promise.resolve(e)},createCacheKey=function(e,t,n,a){var c=new URL(e);return a&&c.pathname.match(a)||(c.search+=(c.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),c.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,t){var n=new URL(e);return n.search=n.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(e){return t.every(function(t){return!t.test(e[0])})}).map(function(e){return e.join("=")}).join("&"),n.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],a=new URL(t,self.location),c=createCacheKey(a,hashParamName,n,!1);return[a.toString(),c]}));self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(e){return setOfCachedUrls(e).then(function(t){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(n){if(!t.has(n)){var a=new Request(n,{credentials:"same-origin"});return fetch(a).then(function(t){if(!t.ok)throw new Error("Request for "+n+" returned a response with status "+t.status);return cleanResponse(t).then(function(t){return e.put(n,t)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var t=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(e){return e.keys().then(function(n){return Promise.all(n.map(function(n){if(!t.has(n.url))return e.delete(n)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(e){if("GET"===e.request.method){var t,n=stripIgnoredUrlParameters(e.request.url,ignoreUrlParametersMatching);t=urlsToCacheKeys.has(n);t||(n=addDirectoryIndex(n,"index.html"),t=urlsToCacheKeys.has(n));!t&&"navigate"===e.request.mode&&isPathWhitelisted(["^((?!(static|api|local|service_worker.js|manifest.json)).)*$"],e.request.url)&&(n=new URL("/",self.location).toString(),t=urlsToCacheKeys.has(n)),t&&e.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(t){return console.warn('Couldn\'t serve response for "%s" from cache: %O',e.request.url,t),fetcLine truncated
+1 -34
View File
@@ -11,8 +11,7 @@ import re
import aiohttp
from aiohttp import web
from aiohttp.web_exceptions import (
HTTPBadGateway, HTTPNotFound, HTTPMethodNotAllowed)
from aiohttp.web_exceptions import HTTPBadGateway
from aiohttp.hdrs import CONTENT_TYPE
import async_timeout
@@ -28,23 +27,6 @@ DEPENDENCIES = ['http']
TIMEOUT = 10
HASSIO_REST_COMMANDS = {
'host/shutdown': ['POST'],
'host/reboot': ['POST'],
'host/update': ['POST'],
'host/info': ['GET'],
'supervisor/info': ['GET'],
'supervisor/update': ['POST'],
'supervisor/options': ['POST'],
'supervisor/reload': ['POST'],
'supervisor/logs': ['GET'],
'homeassistant/info': ['GET'],
'homeassistant/update': ['POST'],
'homeassistant/logs': ['GET'],
'network/info': ['GET'],
'network/options': ['POST'],
}
ADDON_REST_COMMANDS = {
'install': ['POST'],
'uninstall': ['POST'],
@@ -166,21 +148,6 @@ class HassIOView(HomeAssistantView):
@asyncio.coroutine
def _handle(self, request, path):
"""Route data to hassio."""
if path.startswith('addons/'):
parts = path.split('/')
if len(parts) != 3:
raise HTTPNotFound()
allowed_methods = ADDON_REST_COMMANDS.get(parts[-1])
else:
allowed_methods = HASSIO_REST_COMMANDS.get(path)
if allowed_methods is None:
raise HTTPNotFound()
if request.method not in allowed_methods:
raise HTTPMethodNotAllowed(request.method, allowed_methods)
client = yield from self.hassio.command_proxy(path, request)
data = yield from client.read()
+6 -89
View File
@@ -48,32 +48,13 @@ def test_fail_setup_cannot_connect(hass):
@asyncio.coroutine
def test_invalid_path(hassio_client):
"""Test requesting invalid path."""
with patch.dict(ho.HASSIO_REST_COMMANDS, {}, clear=True):
resp = yield from hassio_client.post('/api/hassio/beer')
assert resp.status == 404
@asyncio.coroutine
def test_invalid_method(hassio_client):
"""Test requesting path with invalid method."""
with patch.dict(ho.HASSIO_REST_COMMANDS, {'beer': ['POST']}):
resp = yield from hassio_client.get('/api/hassio/beer')
assert resp.status == 405
@asyncio.coroutine
def test_forward_normal_path(hassio_client):
def test_forward_request(hassio_client):
"""Test fetching normal path."""
response = MagicMock()
response.read.return_value = mock_coro('data')
with patch.dict(ho.HASSIO_REST_COMMANDS, {'beer': ['POST']}), \
patch('homeassistant.components.hassio.HassIO.command_proxy',
Mock(return_value=mock_coro(response))), \
with patch('homeassistant.components.hassio.HassIO.command_proxy',
Mock(return_value=mock_coro(response))), \
patch('homeassistant.components.hassio._create_response') as mresp:
mresp.return_value = 'response'
resp = yield from hassio_client.post('/api/hassio/beer')
@@ -89,14 +70,13 @@ def test_forward_normal_path(hassio_client):
@asyncio.coroutine
def test_forward_normal_log_path(hassio_client):
def test_forward_log_request(hassio_client):
"""Test fetching normal log path."""
response = MagicMock()
response.read.return_value = mock_coro('data')
with patch.dict(ho.HASSIO_REST_COMMANDS, {'beer/logs': ['GET']}), \
patch('homeassistant.components.hassio.HassIO.command_proxy',
Mock(return_value=mock_coro(response))), \
with patch('homeassistant.components.hassio.HassIO.command_proxy',
Mock(return_value=mock_coro(response))), \
patch('homeassistant.components.hassio.'
'_create_response_log') as mresp:
mresp.return_value = 'response'
@@ -112,69 +92,6 @@ def test_forward_normal_log_path(hassio_client):
assert mresp.mock_calls[0][1] == (response, 'data')
@asyncio.coroutine
def test_forward_addon_path(hassio_client):
"""Test fetching addon path."""
response = MagicMock()
response.read.return_value = mock_coro('data')
with patch.dict(ho.ADDON_REST_COMMANDS, {'install': ['POST']}), \
patch('homeassistant.components.hassio.'
'HassIO.command_proxy') as proxy_command, \
patch('homeassistant.components.hassio._create_response') as mresp:
proxy_command.return_value = mock_coro(response)
mresp.return_value = 'response'
resp = yield from hassio_client.post('/api/hassio/addons/beer/install')
# Check we got right response
assert resp.status == 200
body = yield from resp.text()
assert body == 'response'
assert proxy_command.mock_calls[0][1][0] == 'addons/beer/install'
# Check we forwarded command
assert len(mresp.mock_calls) == 1
assert mresp.mock_calls[0][1] == (response, 'data')
@asyncio.coroutine
def test_forward_addon_log_path(hassio_client):
"""Test fetching addon log path."""
response = MagicMock()
response.read.return_value = mock_coro('data')
with patch.dict(ho.ADDON_REST_COMMANDS, {'logs': ['GET']}), \
patch('homeassistant.components.hassio.'
'HassIO.command_proxy') as proxy_command, \
patch('homeassistant.components.hassio.'
'_create_response_log') as mresp:
proxy_command.return_value = mock_coro(response)
mresp.return_value = 'response'
resp = yield from hassio_client.get('/api/hassio/addons/beer/logs')
# Check we got right response
assert resp.status == 200
body = yield from resp.text()
assert body == 'response'
assert proxy_command.mock_calls[0][1][0] == 'addons/beer/logs'
# Check we forwarded command
assert len(mresp.mock_calls) == 1
assert mresp.mock_calls[0][1] == (response, 'data')
@asyncio.coroutine
def test_bad_request_when_wrong_addon_url(hassio_client):
"""Test we cannot mess with addon url."""
resp = yield from hassio_client.get('/api/hassio/addons/../../info')
assert resp.status == 404
resp = yield from hassio_client.get('/api/hassio/addons/info')
assert resp.status == 404
@asyncio.coroutine
def test_bad_gateway_when_cannot_find_supervisor(hassio_client):
"""Test we get a bad gateway error if we can't find supervisor."""