iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
8 lines • 31 kB
JavaScript
webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["99750"],{50875:function(e,t,i){i.d(t,{Eu:()=>r,hZ:()=>s,o9:()=>d});var n=i(27486),o=i(11259);const a=["#4269d0","#f4bd4a","#ff725c","#6cc5b0","#a463f2","#ff8ab7","#9c6b4e","#97bbf5","#01ab63","#9498a0","#094bad","#c99000","#d84f3e","#49a28f","#048732","#d96895","#8043ce","#7599d1","#7a4c31","#74787f","#6989f4","#ffd444","#ff957c","#8fe9d3","#62cc71","#ffadda","#c884ff","#badeff","#bf8b6d","#b6bac2","#927acc","#97ee3f","#bf3947","#9f5b00","#f48758","#8caed6","#f2b94f","#eff26e","#e43872","#d9b100","#9d7a00","#698cff","#d9d9d9","#00d27e","#d06800","#009f82","#c49200","#cbe8ff","#fecddf","#c27eb6","#8cd2ce","#c4b8d9","#f883b0","#a49100","#f48800","#27d0df","#a04a9b"];function r(e){return a[e%a.length]}function s(e,t){const i=t.getPropertyValue(`--graph-color-${e+1}`)||r(e);return(0,o.Rq)(i)}const d=(0,n.Z)((e=>a.map(((t,i)=>s(i,e)))),((e,t)=>e[0].getPropertyValue("--graph-color-1")===t[0].getPropertyValue("--graph-color-1")))},34618:function(e,t,i){i.d(t,{N:()=>n});const n=(e,t=2)=>Math.round(e*10**t)/10**t},29095:function(e,t,i){i.a(e,(async function(e,t){try{var n=i(61701),o=(i(71695),i(47021),i(57243)),a=i(50778),r=(i(59826),i(17170)),s=(i(37583),e([r]));r=(s.then?(await s)():s)[0];let d,l,c,h,p,u,f=e=>e;const y="M2.2,16.06L3.88,12L2.2,7.94L6.26,6.26L7.94,2.2L12,3.88L16.06,2.2L17.74,6.26L21.8,7.94L20.12,12L21.8,16.06L17.74,17.74L16.06,21.8L12,20.12L7.94,21.8L6.26,17.74L2.2,16.06M13,17V15H11V17H13M13,13V7H11V13H13Z",m="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z";(0,n.Z)([(0,a.Mo)("ha-progress-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"progress",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"raised",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"unelevated",value(){return!1}},{kind:"field",decorators:[(0,a.SB)()],key:"_result",value:void 0},{kind:"method",key:"render",value:function(){const e=this._result||this.progress;return(0,o.dy)(d||(d=f` <ha-button .raised="${0}" .label="${0}" .unelevated="${0}" .disabled="${0}" class="${0}"> <slot name="icon" slot="icon"></slot> <slot></slot> </ha-button> ${0} `),this.raised,this.label,this.unelevated,this.disabled||this.progress,this._result||"",e?(0,o.dy)(l||(l=f` <div class="progress"> ${0} </div> `),"success"===this._result?(0,o.dy)(c||(c=f`<ha-svg-icon .path="${0}"></ha-svg-icon>`),m):"error"===this._result?(0,o.dy)(h||(h=f`<ha-svg-icon .path="${0}"></ha-svg-icon>`),y):this.progress?(0,o.dy)(p||(p=f`<ha-spinner size="small"></ha-spinner>`)):o.Ld):o.Ld)}},{kind:"method",key:"actionSuccess",value:function(){this._setResult("success")}},{kind:"method",key:"actionError",value:function(){this._setResult("error")}},{kind:"method",key:"_setResult",value:function(e){this._result=e,setTimeout((()=>{this._result=void 0}),2e3)}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(u||(u=f`:host{outline:0;display:inline-block;position:relative;pointer-events:none}ha-button{transition:all 1s;pointer-events:initial}ha-button.success{--mdc-theme-primary:white;background-color:var(--success-color);transition:none;border-radius:4px;pointer-events:none}ha-button[raised].success,ha-button[unelevated].success{--mdc-theme-primary:var(--success-color);--mdc-theme-on-primary:white}ha-button.error{--mdc-theme-primary:white;background-color:var(--error-color);transition:none;border-radius:4px;pointer-events:none}ha-button[raised].error,ha-button[unelevated].error{--mdc-theme-primary:var(--error-color);--mdc-theme-on-primary:white}.progress{bottom:4px;position:absolute;text-align:center;top:4px;width:100%}ha-svg-icon{color:#fff}ha-button.error slot,ha-button.success slot{visibility:hidden}:host([destructive]){--mdc-theme-primary:var(--error-color)}`))}}]}}),o.oi);t()}catch(d){t(d)}}))},99426:function(e,t,i){i.r(t);var n=i(61701),o=(i(71695),i(47021),i(57243)),a=i(50778),r=i(35359),s=i(36522);i(23334),i(37583);let d,l,c,h,p=e=>e;const u={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};(0,n.Z)([(0,a.Mo)("ha-alert")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)()],key:"title",value(){return""}},{kind:"field",decorators:[(0,a.Cb)({attribute:"alert-type"})],key:"alertType",value(){return"info"}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"dismissable",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,o.dy)(d||(d=p` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,r.$)({[this.alertType]:!0}),this.title?"":"no-title",u[this.alertType],(0,r.$)({content:!0,narrow:this.narrow}),this.title?(0,o.dy)(l||(l=p`<div class="title">${0}</div>`),this.title):o.Ld,this.dismissable?(0,o.dy)(c||(c=p`<ha-icon-button @click="${0}" label="Dismiss alert" .path="${0}"></ha-icon-button>`),this._dismissClicked,"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"):o.Ld)}},{kind:"method",key:"_dismissClicked",value:function(){(0,s.B)(this,"alert-dismissed-clicked")}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(h||(h=p`.issue-type{position:relative;padding:8px;display:flex}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:4px}.icon{z-index:1}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:0}.title{margin-top:2px;font-weight:700}.action ha-icon-button,.action mwc-button{--mdc-theme-primary:var(--primary-text-color);--mdc-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`))}}]}}),o.oi)},59826:function(e,t,i){var n=i(61701),o=(i(71695),i(47021),i(31622)),a=i(57243),r=i(50778),s=i(22344);let d,l=e=>e;(0,n.Z)([(0,r.Mo)("ha-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[s.W,(0,a.iv)(d||(d=l`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}:host([destructive]){--mdc-theme-primary:var(--error-color)}`))]}}]}}),o.Button)},4935:function(e,t,i){var n=i(61701),o=i(72621),a=(i(71695),i(47021),i(57243)),r=i(50778),s=i(7285);let d,l,c,h,p=e=>e;(0,n.Z)([(0,r.Mo)("ha-clickable-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)()],key:"href",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:"disable-href",type:Boolean})],key:"disableHref",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:"open-new-tab",type:Boolean,reflect:!0})],key:"openNewTab",value(){return!1}},{kind:"field",decorators:[(0,r.IO)("a")],key:"_anchor",value:void 0},{kind:"method",key:"render",value:function(){const e=(0,o.Z)(i,"render",this,3)([]),t=this.href||"";return(0,a.dy)(d||(d=p`${0}`),this.disableHref?(0,a.dy)(l||(l=p`<a href="#" class="disabled">${0}</a>`),e):(0,a.dy)(c||(c=p`<a target="${0}" href="${0}">${0}</a>`),this.openNewTab?"_blank":"",t,e))}},{kind:"method",key:"firstUpdated",value:function(){(0,o.Z)(i,"firstUpdated",this,3)([]),this.addEventListener("keydown",(e=>{"Enter"!==e.key&&" "!==e.key||this._anchor.click()}))}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,o.Z)(i,"styles",this),(0,a.iv)(h||(h=p`a{width:100%;height:100%;display:flex;align-items:center;overflow:hidden}.disabled{pointer-events:none}`))]}}]}}),s.M)},30509:function(e,t,i){var n=i(61701),o=(i(71695),i(47021),i(57243)),a=i(50778);let r,s,d=e=>e;(0,n.Z)([(0,a.Mo)("ha-settings-row")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean,reflect:!0})],key:"slim",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean,attribute:"three-line"})],key:"threeLine",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean,attribute:"wrap-heading",reflect:!0})],key:"wrapHeading",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,o.dy)(r||(r=d` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" ?two-line="${0}" ?three-line="${0}"> <slot name="heading"></slot> <div class="secondary"><slot name="description"></slot></div> </div> </div> <div class="content"><slot></slot></div> `),!this.threeLine,this.threeLine)}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(s||(s=d`:host{display:flex;padding:0 16px;align-content:normal;align-self:auto;align-items:center}.body{padding-top:8px;padding-bottom:8px;padding-left:0;padding-inline-start:0;padding-right:16px;padding-inline-end:16px;overflow:hidden;display:var(--layout-vertical_-_display,flex);flex-direction:var(--layout-vertical_-_flex-direction,column);justify-content:var(--layout-center-justified_-_justify-content,center);flex:var(--layout-flex_-_flex,1);flex-basis:var(--layout-flex_-_flex-basis,0.000000001px)}.body[three-line]{min-height:var(--paper-item-body-three-line-min-height,88px)}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:4px;font-family:var(
--mdc-typography-body2-font-family,
var(--mdc-typography-font-family, Roboto, sans-serif)
);-webkit-font-smoothing:antialiased;font-size:var(--mdc-typography-body2-font-size, .875rem);font-weight:var(--mdc-typography-body2-font-weight,400);line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(var(--paper-item-body-two-line-min-height,72px) - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;padding:16px 0}.content ::slotted(*){width:var(--settings-row-content-width)}:host([narrow]){align-items:normal;flex-direction:column;border-top:1px solid var(--divider-color);padding-bottom:8px}::slotted(ha-switch){padding:16px 0}.secondary{white-space:normal}.prefix-wrap{display:var(--settings-row-prefix-display)}:host([narrow]) .prefix-wrap{display:flex;align-items:center}:host([slim]),:host([slim]) .content,:host([slim]) ::slotted(ha-switch){padding:0}:host([slim]) .body{min-height:0}`))}}]}}),o.oi)},17170:function(e,t,i){i.a(e,(async function(e,n){try{i.r(t),i.d(t,{HaSpinner:()=>u});var o=i(61701),a=i(72621),r=(i(71695),i(47021),i(97677)),s=i(43580),d=i(57243),l=i(50778),c=e([r]);r=(c.then?(await c)():c)[0];let h,p=e=>e,u=(0,o.Z)([(0,l.Mo)("ha-spinner")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,a.Z)(i,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}},{kind:"field",static:!0,key:"styles",value(){return[s.Z,(0,d.iv)(h||(h=p`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}]}}),r.Z);n()}catch(h){n(h)}}))},75101:function(e,t,i){i.d(t,{$H:()=>n,DJ:()=>s,LZ:()=>a,Nn:()=>p,Ny:()=>u,Pk:()=>y,Q4:()=>r,RQ:()=>l,SO:()=>c,T0:()=>f,aR:()=>o,iJ:()=>h,pB:()=>d});i(71695),i(9359),i(56475),i(1331),i(19423),i(47021);const n=(e,t)=>e.callWS({type:"config_entries/subentries/list",entry_id:t}),o=(e,t,i)=>e.callWS({type:"config_entries/subentries/delete",entry_id:t,subentry_id:i}),a=["migration_error","setup_error","setup_retry"],r=["not_loaded","loaded","setup_error","setup_retry"],s=(e,t,i)=>{const n={type:"config_entries/subscribe"};return i&&i.type&&(n.type_filter=i.type),e.connection.subscribeMessage((e=>t(e)),n)},d=(e,t)=>{const i={};return t&&(t.type&&(i.type_filter=t.type),t.domain&&(i.domain=t.domain)),e.callWS(Object.assign({type:"config_entries/get"},i))},l=(e,t)=>e.callWS({type:"config_entries/get_single",entry_id:t}),c=(e,t,i)=>e.callWS(Object.assign({type:"config_entries/update",entry_id:t},i)),h=(e,t)=>e.callApi("DELETE",`config/config_entries/entry/${t}`),p=(e,t)=>e.callApi("POST",`config/config_entries/entry/${t}/reload`),u=(e,t)=>e.callWS({type:"config_entries/disable",entry_id:t,disabled_by:"user"}),f=(e,t)=>e.callWS({type:"config_entries/disable",entry_id:t,disabled_by:null}),y=(e,t)=>{if(!t)return e;const i=e.find((e=>e.entry_id===t));if(!i)return e;return[i,...e.filter((e=>e.entry_id!==t))]}},45594:function(e,t,i){i.d(t,{Fv:()=>r,e1:()=>a,eH:()=>n,lJ:()=>o});const n=(e,t)=>{var i;return e.callApi("POST","config/config_entries/options/flow",{handler:t,show_advanced_options:Boolean(null===(i=e.userData)||void 0===i?void 0:i.showAdvanced)})},o=(e,t)=>e.callApi("GET",`config/config_entries/options/flow/${t}`),a=(e,t,i)=>e.callApi("POST",`config/config_entries/options/flow/${t}`,i),r=(e,t)=>e.callApi("DELETE",`config/config_entries/options/flow/${t}`)},32503:function(e,t,i){i.d(t,{k:()=>n});const n=e=>e.callWS({type:"usb/scan"})},7956:function(e,t,i){i.d(t,{w:()=>a});i(71695),i(19423),i(40251),i(47021);var n=i(36522);const o=()=>Promise.all([i.e("46379"),i.e("66031"),i.e("72206"),i.e("97983"),i.e("24199"),i.e("78943"),i.e("2142"),i.e("58640"),i.e("52430"),i.e("4697"),i.e("43429"),i.e("27090"),i.e("8949")]).then(i.bind(i,12656)),a=(e,t,i)=>{(0,n.B)(e,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:o,dialogParams:Object.assign(Object.assign({},t),{},{flowConfig:i,dialogParentElement:e})})}},91854:function(e,t,i){i.d(t,{c:()=>f});i(71695),i(19423),i(40251),i(47021);var n=i(57243),o=i(57816),a=i(45594),r=i(7956);let s,d,l,c,h,p,u=e=>e;const f=(e,t,i)=>(0,r.w)(e,Object.assign({startFlowHandler:t.entry_id,domain:t.domain},i),{flowType:"options_flow",showDevices:!1,createFlow:async(e,i)=>{const[n]=await Promise.all([(0,a.eH)(e,i),e.loadFragmentTranslation("config"),e.loadBackendTranslation("options",t.domain),e.loadBackendTranslation("selector",t.domain)]);return n},fetchFlow:async(e,i)=>{const[n]=await Promise.all([(0,a.lJ)(e,i),e.loadFragmentTranslation("config"),e.loadBackendTranslation("options",t.domain),e.loadBackendTranslation("selector",t.domain)]);return n},handleFlowStep:a.e1,deleteFlow:a.Fv,renderAbortDescription(e,i){const o=e.localize(`component.${i.translation_domain||t.domain}.options.abort.${i.reason}`,i.description_placeholders);return o?(0,n.dy)(s||(s=u` <ha-markdown breaks allow-svg .content="${0}"></ha-markdown> `),o):i.reason},renderShowFormStepHeader(e,i){return e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.title`,i.description_placeholders)||e.localize("ui.dialogs.options_flow.form.header")},renderShowFormStepDescription(e,i){const o=e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.description`,i.description_placeholders);return o?(0,n.dy)(d||(d=u` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),o):""},renderShowFormStepFieldLabel(e,i,n,o){var a;if("expandable"===n.type)return e.localize(`component.${t.domain}.options.step.${i.step_id}.sections.${n.name}.name`);const r=null!=o&&null!==(a=o.path)&&void 0!==a&&a[0]?`sections.${o.path[0]}.`:"";return e.localize(`component.${t.domain}.options.step.${i.step_id}.${r}data.${n.name}`)||n.name},renderShowFormStepFieldHelper(e,i,o,a){var r;if("expandable"===o.type)return e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.sections.${o.name}.description`);const s=null!=a&&null!==(r=a.path)&&void 0!==r&&r[0]?`sections.${a.path[0]}.`:"",d=e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.${s}data_description.${o.name}`,i.description_placeholders);return d?(0,n.dy)(l||(l=u`<ha-markdown breaks .content="${0}"></ha-markdown>`),d):""},renderShowFormStepFieldError(e,i,n){return e.localize(`component.${i.translation_domain||t.domain}.options.error.${n}`,i.description_placeholders)||n},renderShowFormStepFieldLocalizeValue(e,i,n){return e.localize(`component.${t.domain}.selector.${n}`)},renderShowFormStepSubmitButton(e,i){return e.localize(`component.${t.domain}.options.step.${i.step_id}.submit`)||e.localize("ui.panel.config.integrations.config_flow."+(!1===i.last_step?"next":"submit"))},renderExternalStepHeader(e,t){return""},renderExternalStepDescription(e,t){return""},renderCreateEntryDescription(e,t){return(0,n.dy)(c||(c=u` <p>${0}</p> `),e.localize("ui.dialogs.options_flow.success.description"))},renderShowFormProgressHeader(e,i){return e.localize(`component.${t.domain}.options.step.${i.step_id}.title`)||e.localize(`component.${t.domain}.title`)},renderShowFormProgressDescription(e,i){const o=e.localize(`component.${i.translation_domain||t.domain}.options.progress.${i.progress_action}`,i.description_placeholders);return o?(0,n.dy)(h||(h=u` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),o):""},renderMenuHeader(e,i){return e.localize(`component.${t.domain}.options.step.${i.step_id}.title`)||e.localize(`component.${t.domain}.title`)},renderMenuDescription(e,i){const o=e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.description`,i.description_placeholders);return o?(0,n.dy)(p||(p=u` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),o):""},renderMenuOption(e,i,n){return e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.menu_options.${n}`,i.description_placeholders)},renderLoadingDescription(e,i){return e.localize(`component.${t.domain}.options.loading`)||("loading_flow"===i||"loading_step"===i?e.localize(`ui.dialogs.options_flow.loading.${i}`,{integration:(0,o.Lh)(e.localize,t.domain)}):"")}})},40656:function(e,t,i){i.a(e,(async function(e,n){try{i.r(t);var o=i(61701),a=i(72621),r=(i(71695),i(92745),i(9359),i(56475),i(1331),i(31526),i(70104),i(52924),i(19423),i(40251),i(47021),i(2060),i(87319),i(57243)),s=i(50778),d=i(27486),l=i(72344),c=i(34618),h=i(45061),p=i(29095),u=i(25179),f=(i(99426),i(54977),i(4935),i(23334),i(13928),i(30509),i(75101)),y=i(46900),m=i(67044),v=i(32503),g=i(91854),b=i(12170),_=(i(87979),i(6736)),w=i(36671),k=i(28008),$=i(88238),x=i(51527),L=i(56785),z=e([p,u]);[p,u]=z.then?(await z)():z;let S,C,E,M,F,D,B,H,A,O,T,Z,P,V,j,R,W=e=>e;const I="M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",U=60,N={type:"line",color:w.QF,areaStyle:{color:w.QF+"2B"},symbolSize:0,lineStyle:{width:1},smooth:.25};(0,o.Z)([(0,s.Mo)("ha-config-hardware")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,s.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_OSData",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_hardwareInfo",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_chartOptions",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_systemStatusData",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_configEntries",value:void 0},{kind:"field",key:"_memoryEntries",value(){return[]}},{kind:"field",key:"_cpuEntries",value(){return[]}},{kind:"method",key:"hassSubscribe",value:function(){const e=[(0,f.DJ)(this.hass,(e=>{let t=!1;const i=[];if(e.forEach((e=>{if(null===e.type||"added"===e.type)i.push(e.entry),null===e.type&&(t=!0);else if("removed"===e.type)this._configEntries&&delete this._configEntries[e.entry.entry_id];else if("updated"===e.type&&this._configEntries){const t=e.entry;this._configEntries[e.entry.entry_id]=t}})),!i.length&&!t)return;const n=[...t?[]:Object.values(this._configEntries||{}),...i],o={};for(const a of n)o[a.entry_id]=a;this._configEntries=o}),{type:["hardware"]})];return(0,l.p)(this.hass,"hardware")&&e.push(this.hass.connection.subscribeMessage((e=>{this._memoryEntries.shift(),this._cpuEntries.shift(),this._memoryEntries.push([new Date(e.timestamp).getTime(),e.memory_used_percent]),this._cpuEntries.push([new Date(e.timestamp).getTime(),e.cpu_percent]),this._systemStatusData=e}),{type:"hardware/subscribe_system_status"})),e}},{kind:"method",key:"willUpdate",value:function(){this.hasUpdated||this._chartOptions||(this._chartOptions={xAxis:{type:"time"},yAxis:{type:"value",splitLine:{show:!0},axisLabel:{formatter:e=>e+(0,h.K)(this.hass.locale)+"%"},axisLine:{show:!1},scale:!0},grid:{top:10,bottom:10,left:10,right:10,containLabel:!0},tooltip:{trigger:"axis",valueFormatter:e=>e+(0,h.K)(this.hass.locale)+"%"}})}},{kind:"method",key:"firstUpdated",value:function(e){(0,a.Z)(i,"firstUpdated",this,3)([e]),this._load();const t=new Date;for(let i=0;i<U;i++){const e=new Date(t);e.setSeconds(e.getSeconds()-5*(U-i)),this._memoryEntries.push([e.getTime(),null]),this._cpuEntries.push([e.getTime(),null])}}},{kind:"method",key:"render",value:function(){var e,t,i;let n,o,a,s,d=[];const p=null===(e=this._hardwareInfo)||void 0===e?void 0:e.hardware.find((e=>null!==e.board)),u=null===(t=this._hardwareInfo)||void 0===t?void 0:t.hardware.filter((e=>null!==e.dongle&&(!e.config_entries.length||e.config_entries.some((e=>{var t;return(null===(t=this._configEntries)||void 0===t?void 0:t[e])&&!this._configEntries[e].disabled_by})))));var f;p?(d=p.config_entries.map((e=>{var t;return null===(t=this._configEntries)||void 0===t?void 0:t[e]})).filter((e=>(null==e?void 0:e.supports_options)&&!e.disabled_by)),n=p.board.hassio_board_id,o=p.name,s=p.url,a=(0,$.RU)({category:"boards",manufacturer:p.board.manufacturer,model:p.board.model,darkOptimized:null===(f=this.hass.themes)||void 0===f?void 0:f.darkMode})):null!==(i=this._OSData)&&void 0!==i&&i.board&&(n=this._OSData.board,o=y.d[this._OSData.board]);return(0,r.dy)(S||(S=W` <hass-subpage back-path="/config/system" .hass="${0}" .narrow="${0}" .header="${0}"> ${0} ${0} <div class="content"> ${0} ${0} ${0} </div> </hass-subpage> `),this.hass,this.narrow,this.hass.localize("ui.panel.config.hardware.caption"),(0,l.p)(this.hass,"hassio")?(0,r.dy)(C||(C=W` <ha-icon-button slot="toolbar-icon" .path="${0}" .label="${0}" @click="${0}"></ha-icon-button> `),I,this.hass.localize("ui.panel.config.hardware.restart_homeassistant"),this._showRestartDialog):"",this._error?(0,r.dy)(E||(E=W`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):"",o||(0,l.p)(this.hass,"hassio")?(0,r.dy)(M||(M=W` <ha-card outlined> <div class="card-content"> ${0} <div class="board-info"> <p class="primary-text"> ${0} </p> ${0} </div> </div> ${0} ${0} </ha-card> `),a?(0,r.dy)(F||(F=W`<img alt="" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer">`),a):"",o||this.hass.localize("ui.panel.config.hardware.generic_hardware"),n?(0,r.dy)(D||(D=W`<p class="secondary-text">${0}</p>`),n):"",s?(0,r.dy)(B||(B=W` <mwc-list> <ha-clickable-list-item .href="${0}" open-new-tab twoline hasMeta> <span>${0}</span> <span slot="secondary">${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </ha-clickable-list-item> </mwc-list> `),s,this.hass.localize("ui.panel.config.hardware.documentation"),this.hass.localize("ui.panel.config.hardware.documentation_description")):"",d.length||(0,l.p)(this.hass,"hassio")?(0,r.dy)(H||(H=W`<div class="card-actions"> ${0} ${0} </div>`),d.length?(0,r.dy)(A||(A=W` <mwc-button .entry="${0}" @click="${0}"> ${0} </mwc-button> `),d[0],this._openOptionsFlow,this.hass.localize("ui.panel.config.hardware.configure")):r.Ld,(0,l.p)(this.hass,"hassio")?(0,r.dy)(O||(O=W` <mwc-button @click="${0}"> ${0} </mwc-button> `),this._openHardware,this.hass.localize("ui.panel.config.hardware.available_hardware.title")):r.Ld):""):"",null!=u&&u.length?(0,r.dy)(T||(T=W`<ha-card outlined> ${0} </ha-card>`),u.map((e=>{const t=e.config_entries.map((e=>{var t;return null===(t=this._configEntries)||void 0===t?void 0:t[e]})).filter((e=>(null==e?void 0:e.supports_options)&&!e.disabled_by))[0];return(0,r.dy)(Z||(Z=W`<div class="row"> ${0}${0} </div>`),e.name,t?(0,r.dy)(P||(P=W`<mwc-button .entry="${0}" @click="${0}"> ${0} </mwc-button>`),t,this._openOptionsFlow,this.hass.localize("ui.panel.config.hardware.configure")):"")}))):"",this._systemStatusData?(0,r.dy)(V||(V=W`<ha-card outlined> <div class="header"> <div class="title"> ${0} </div> <div class="value"> ${0}${0}% </div> </div> <div class="card-content"> <ha-chart-base .hass="${0}" .data="${0}" .options="${0}"></ha-chart-base> </div> </ha-card> <ha-card outlined> <div class="header"> <div class="title"> ${0} </div> <div class="value"> ${0} GB / ${0} GB </div> </div> <div class="card-content"> <ha-chart-base .hass="${0}" .data="${0}" .options="${0}"></ha-chart-base> </div> </ha-card>`),this.hass.localize("ui.panel.config.hardware.processor"),this._systemStatusData.cpu_percent||"-",(0,h.K)(this.hass.locale),this.hass,this._getChartData(this._cpuEntries),this._chartOptions,this.hass.localize("ui.panel.config.hardware.memory"),(0,c.N)(this._systemStatusData.memory_used_mb/1024,1),(0,c.N)((this._systemStatusData.memory_used_mb+this._systemStatusData.memory_free_mb)/1024,0),this.hass,this._getChartData(this._memoryEntries),this._chartOptions):(0,l.p)(this.hass,"hardware")?(0,r.dy)(j||(j=W`<ha-card outlined> <div class="card-content"> <div class="value"> ${0} </div> </div> </ha-card>`),this.hass.localize("ui.panel.config.hardware.loading_system_data")):"")}},{kind:"method",key:"_load",value:async function(){(0,l.p)(this.hass,"usb")&&await(0,v.k)(this.hass);const e=(0,l.p)(this.hass,"hassio");try{var t;(0,l.p)(this.hass,"hardware")&&(this._hardwareInfo=await this.hass.callWS({type:"hardware/info"})),!e||null!==(t=this._hardwareInfo)&&void 0!==t&&t.hardware.length||(this._OSData=await(0,m.AP)(this.hass))}catch(i){this._error=(0,L.js)(i)}}},{kind:"method",key:"_openOptionsFlow",value:async function(e){const t=e.currentTarget.entry;t&&(0,g.c)(this,t)}},{kind:"method",key:"_openHardware",value:async function(){(0,x.l)(this)}},{kind:"method",key:"_showRestartDialog",value:async function(){(0,b.s)(this)}},{kind:"field",key:"_getChartData",value(){return(0,d.Z)((e=>[Object.assign(Object.assign({},N),{},{id:e===this._cpuEntries?"cpu":"memory",name:e===this._cpuEntries?this.hass.localize("ui.panel.config.hardware.processor"):this.hass.localize("ui.panel.config.hardware.memory"),data:e})]))}},{kind:"field",static:!0,key:"styles",value(){return[k.Qx,(0,r.iv)(R||(R=W`.content{padding:28px 20px 0;max-width:1040px;margin:0 auto;--mdc-list-side-padding:24px;--mdc-list-vertical-padding:0}ha-card{max-width:600px;margin:0 auto;height:100%;justify-content:space-between;flex-direction:column;display:flex;margin-bottom:16px}.card-content{display:flex;justify-content:space-between;flex-direction:column;padding:16px}.card-content img{max-width:300px;margin:auto}.board-info{text-align:center}.primary-text{font-size:16px;margin:0}.secondary-text{font-size:14px;margin-bottom:0;color:var(--secondary-text-color)}.header{padding:16px;display:flex;justify-content:space-between}.header .title{color:var(--secondary-text-color);font-size:18px}.header .value{font-size:16px}.row{display:flex;justify-content:space-between;align-items:center;height:48px;padding:8px 16px}.card-actions{display:flex;justify-content:space-between}`))]}}]}}),(0,_.f)(r.oi));n()}catch(S){n(S)}}))},51527:function(e,t,i){i.d(t,{l:()=>a});i(71695),i(40251),i(47021);var n=i(36522);const o=()=>Promise.all([i.e("46379"),i.e("66031"),i.e("97983"),i.e("2142"),i.e("8795"),i.e("72372")]).then(i.bind(i,42809)),a=e=>{(0,n.B)(e,"show-dialog",{dialogTag:"ha-dialog-hardware-available",dialogImport:o,dialogParams:{}})}},31948:function(e,t,i){i.a(e,(async function(e,t){try{i(71695),i(40251),i(47021);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await i.e("73378").then(i.bind(i,88198))).default),t()}catch(n){t(n)}}),1)},88238:function(e,t,i){i.d(t,{RU:()=>o,X1:()=>n,u4:()=>a,zC:()=>r});i(88044);const n=e=>`https://brands.home-assistant.io/${e.brand?"brands/":""}${e.useFallback?"_/":""}${e.domain}/${e.darkOptimized?"dark_":""}${e.type}.png`,o=e=>`https://brands.home-assistant.io/hardware/${e.category}/${e.darkOptimized?"dark_":""}${e.manufacturer}${e.model?`_${e.model}`:""}.png`,a=e=>e.split("/")[4],r=e=>e.startsWith("https://brands.home-assistant.io/")}}]);
//# sourceMappingURL=99750.d46feb378097d4b5.js.map
;(self.