iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 7.77 kB
JavaScript
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[74723],{26571:function(e,t,i){i.d(t,{Al:function(){return o},KY:function(){return s},PN:function(){return c},dG:function(){return l},jm:function(){return d},m7:function(){return f},sR:function(){return h},t1:function(){return a},t2:function(){return p},x:function(){return g},yu:function(){return u}});var n=i(95350);const s=["bluetooth","dhcp","discovery","esphome","hardware","hassio","homekit","integration_discovery","mqtt","ssdp","unignore","usb","zeroconf"],o=["reauth"],r={"HA-Frontend-Base":`${location.protocol}//${location.host}`},a=(e,t,i)=>e.callApi("POST","config/config_entries/flow",{handler:t,entry_id:i},r),c=(e,t)=>e.callApi("GET",`config/config_entries/flow/${t}`,void 0,r),d=(e,t,i)=>e.callApi("POST",`config/config_entries/flow/${t}`,i,r),l=(e,t,i)=>e.callWS({type:"config_entries/ignore_flow",flow_id:t,title:i}),h=(e,t)=>e.callApi("DELETE",`config/config_entries/flow/${t}`),u=(e,t)=>e.callApi("GET","config/config_entries/flow_handlers"+(t?`?type=${t}`:"")),p=e=>e.sendMessagePromise({type:"config_entries/flow/progress"}),g=(e,t)=>e.connection.subscribeMessage(e=>t(e),{type:"config_entries/flow/subscribe"}),f=(e,t)=>t.context.title_placeholders&&0!==Object.keys(t.context.title_placeholders).length?e(`component.${t.handler}.config.flow_title`,t.context.title_placeholders)||("name"in t.context.title_placeholders?t.context.title_placeholders.name:(0,n.p$)(e,t.handler)):(0,n.p$)(e,t.handler)},42262:function(e,t,i){i.d(t,{$:function(){return n},l:function(){return s}});const n=e=>e.callWS({type:"usb/scan"}),s=e=>e.callWS({type:"usb/list_serial_ports"})},54706:function(e,t,i){i.d(t,{E:function(){return o}});i(74423),i(18111),i(13579),i(3362),i(62953);var n=i(40445),s=i(67576);const o=e=>{class t extends e{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const e=this.__unsubs.pop();e instanceof Promise?e.then(e=>e()):e()}this.__unsubs=void 0}}updated(e){if(super.updated(e),e.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const t of e.keys())if(this.hassSubscribeRequiredHostProps.includes(t))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){var e;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(e=this.hassSubscribeRequiredHostProps)&&void 0!==e&&e.some(e=>void 0===this[e])||(this.__unsubs=this.hassSubscribe())}}return(0,n.Cg)([(0,s.MZ)({attribute:!1})],t.prototype,"hass",void 0),t}},73561:function(e,t,i){i(62953);var n=i(40445),s=i(5124),o=i(67576),r=i(44144);let a,c,d=e=>e;class l extends s.WF{render(){return(0,s.qy)(a||(a=d` <div class="icon"> <img alt="" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> </div> <div class="title">${0}</div> `),(0,r.MR)({domain:this.domain,type:"icon",darkOptimized:this.darkOptimizedIcon},location.origin),this.title)}constructor(...e){super(...e),this.darkOptimizedIcon=!1,this.clickable=!1}}l.styles=(0,s.AH)(c||(c=d`:host{display:inline-flex;flex-direction:column;text-align:center;color:var(--primary-text-color)}img{max-width:100%;max-height:100%}.icon{position:relative;margin:0 auto 8px;height:40px;width:40px;display:flex;align-items:center;justify-content:center}.title{min-height:2.3em;word-break:break-word}`)),(0,n.Cg)([(0,o.MZ)()],l.prototype,"domain",void 0),(0,n.Cg)([(0,o.MZ)({attribute:!1})],l.prototype,"title",void 0),(0,n.Cg)([(0,o.MZ)({attribute:"dark-optimized-icon",type:Boolean})],l.prototype,"darkOptimizedIcon",void 0),(0,n.Cg)([(0,o.MZ)({attribute:!1})],l.prototype,"clickable",void 0),l=(0,n.Cg)([(0,o.EM)("integration-badge")],l)},35502:function(e,t,i){i.a(e,async function(e,n){try{i.r(t);i(44114),i(26910),i(18111),i(22489),i(7588),i(61701),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var s=i(40445),o=i(5124),r=i(67576),a=i(36312),c=i(1087),d=i(52220),l=i(18350),h=i(77423),u=i(26571),p=i(95350),g=i(42262),f=i(54706),b=(i(73561),i(54819)),_=e([l]);l=(_.then?(await _)():_)[0];let m,v,y,k,w,x=e=>e;const $=new Set(["backup","google_translate","hassio","met","radio_browser","rpi_power","shopping_list","sun"]);class S extends((0,f.E)(o.WF)){hassSubscribe(){return[(0,u.x)(this.hass,e=>{e.forEach(e=>{"removed"===e.type||$.has(e.flow.handler)||this._discoveredDomains.add(e.flow.handler)}),this.hass.loadBackendTranslation("title",Array.from(this._discoveredDomains)),this._discoveredDomainsReceived=!0}),(0,h.TC)(this.hass,e=>{let t=!1;const i=[],n=new Set;if(e.forEach(e=>{if(null===e.type||"added"===e.type){if($.has(e.entry.domain))return;i.push(e.entry),n.add(e.entry.domain),null===e.type&&(t=!0)}else if("removed"===e.type)this._entries=this._entries.filter(t=>t.entry_id!==e.entry.entry_id);else if("updated"===e.type){if($.has(e.entry.domain))return;const t=e.entry;this._entries=this._entries.map(e=>e.entry_id===t.entry_id?t:e)}}),!i.length&&!t)return;this.hass.loadBackendTranslation("title",Array.from(n));const s=t?[]:this._entries;this._entries=[...s,...i]},{type:["device","hub","service"]})]}render(){if(!this._discoveredDomainsReceived)return o.s6;let e=new Set;this._entries.forEach(t=>{e.add(t.domain)}),e=new Set([...e,...this._discoveredDomains]);let t=[];for(const n of e.values())t.push([n,(0,p.p$)(this.hass.localize,n)]);t=t.sort((e,t)=>(0,d.xL)(e[0],t[0],this.hass.locale.language));const i=t.length;return 0===i?(0,o.qy)(m||(m=x` <div class="all-set-icon">🎉</div> <h1> ${0} </h1> <p> ${0} </p> <div class="footer"> <ha-button @click="${0}"> ${0} </ha-button> </div> `),this.onboardingLocalize("ui.panel.page-onboarding.integration.all_set"),this.onboardingLocalize("ui.panel.page-onboarding.integration.lets_start"),this._finish,this.onboardingLocalize("ui.panel.page-onboarding.integration.finish")):(t.length>12&&(t=t.slice(0,11)),(0,o.qy)(v||(v=x` <h1> ${0} </h1> <p> ${0} </p> <div class="badges"> ${0} ${0} </div> <div class="footer"> <ha-button @click="${0}"> ${0} </ha-button> </div> `),this.onboardingLocalize("ui.panel.page-onboarding.integration.header"),this.onboardingLocalize("ui.panel.page-onboarding.integration.intro"),t.map(([e,t])=>{var i;return(0,o.qy)(y||(y=x`<integration-badge .domain="${0}" .title="${0}" .darkOptimizedIcon="${0}"></integration-badge>`),e,t,null===(i=this.hass.themes)||void 0===i?void 0:i.darkMode)}),i>t.length?(0,o.qy)(k||(k=x`<div class="more"> ${0} </div>`),this.onboardingLocalize("ui.panel.page-onboarding.integration.more_integrations",{count:i-t.length})):o.s6,this._finish,this.onboardingLocalize("ui.panel.page-onboarding.integration.finish")))}firstUpdated(e){super.firstUpdated(e),this.hass.loadBackendTranslation("title"),this._scanUSBDevices()}async _scanUSBDevices(){(0,a.x)(this.hass.config,"usb")&&await(0,g.$)(this.hass)}async _finish(){(0,c.r)(this,"onboarding-step",{type:"integration"})}static get styles(){return[b.o,(0,o.AH)(w||(w=x`.badges{margin-top:24px;display:grid;grid-template-columns:repeat(auto-fill,minmax(106px,1fr));row-gap:var(--ha-space-6)}.more{display:flex;justify-content:center;align-items:center;height:100%}.all-set-icon{font-size:64px;text-align:center}`))]}constructor(...e){super(...e),this._entries=[],this._discoveredDomains=new Set,this._discoveredDomainsReceived=!1}}(0,s.Cg)([(0,r.MZ)({attribute:!1})],S.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],S.prototype,"onboardingLocalize",void 0),(0,s.Cg)([(0,r.wk)()],S.prototype,"_entries",void 0),(0,s.Cg)([(0,r.wk)()],S.prototype,"_discoveredDomains",void 0),(0,s.Cg)([(0,r.wk)()],S.prototype,"_discoveredDomainsReceived",void 0),S=(0,s.Cg)([(0,r.EM)("onboarding-integrations")],S),n()}catch(m){n(m)}})}}]);