UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

2 lines 7.09 kB
/*! For license information please see 60411.7b11eeb4912051c8.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[60411],{95350:function(e,t,s){s.d(t,{$h:function(){return p},FP:function(){return _},Og:function(){return r},QC:function(){return u},QQ:function(){return o},S1:function(){return a},Ud:function(){return y},fK:function(){return c},l7:function(){return l},nQ:function(){return f},p$:function(){return h}});s(3362),s(62953);if(66649!=s.j)var n=s(90889);var i=s(9899);const r=66649!=s.j?{bluetooth:"config/bluetooth",dhcp:"config/dhcp",matter:"config/matter",mqtt:"config/mqtt",ssdp:"config/ssdp",thread:"config/thread",zeroconf:"config/zeroconf",zha:"config/zha/dashboard",zwave_js:"config/zwave_js/dashboard"}:null;var a=66649!=s.j?function(e){return e[e.CRITICAL=50]="CRITICAL",e[e.ERROR=40]="ERROR",e[e.WARNING=30]="WARNING",e[e.INFO=20]="INFO",e[e.DEBUG=10]="DEBUG",e[e.NOTSET=0]="NOTSET",e}({}):null;const o=(e,t)=>t.issue_tracker||`https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+${e}%22`,h=(e,t,s)=>e(`component.${t}.title`)||(null==s?void 0:s.name)||t,c=(e,t)=>{const s={type:"manifest/list"};return t&&(s.integrations=t),e.callWS(s)},l=async(e,t)=>{const s=await e.sendMessagePromise({type:"manifest/list"}),n={};for(const i of s)n[i.domain]=i;return t(n),()=>{}},u=(e,t)=>e.callWS({type:"manifest/get",integration:t}),p=e=>e.callWS({type:"integration/setup_info"}),g=e=>e.sendMessagePromise({type:"logger/log_info"}),f=(e,t,s,n)=>e.callWS({type:"logger/integration_log_level",integration:t,level:s,persistence:n}),d=(e,t)=>e.subscribeEvents((0,i.s)(()=>g(e).then(e=>t.setState(e,!0)),200,!0),"logging_changed"),_=(e,t)=>(0,n.N)("_integration_log_info",g,d,e,t),y=(e,t)=>e.callWS({type:"integration/wait",domain:t})},97431:function(e,t,s){s.a(e,async function(e,n){try{s.r(t),s.d(t,{EnergySetupWizard:function(){return R}});s(3362),s(62953);var i=s(40445),r=s(5124),a=s(67576),o=s(1087),h=s(38114),c=s(65063),l=s(14503),u=s(23206),p=s(76135),g=s(28166),f=s(54081),d=s(38726),_=s(70604),y=s(18350),v=e([u,p,g,f,d,_,y,h]);[u,p,g,f,d,_,y,h]=v.then?(await v)():v;let $,b,m,x,C,w,k,z,q,A,D,N,O=e=>e;class R extends r.WF{getCardSize(){return 10}setConfig(e){e.preferences&&(this._preferences=e.preferences)}firstUpdated(){this.hass.loadFragmentTranslation("config"),this._fetchconfig()}render(){return(0,r.qy)($||($=O` <p> ${0} </p> ${0} <div class="buttons"> ${0} ${0} </div> `),this.hass.localize("ui.panel.energy.setup.step",{step:this._step+1,steps:6}),0===this._step?(0,r.qy)(b||(b=O`<ha-energy-grid-settings .hass="${0}" .preferences="${0}" @value-changed="${0}"></ha-energy-grid-settings>`),this.hass,this._preferences,this._prefsChanged):1===this._step?(0,r.qy)(m||(m=O`<ha-energy-solar-settings .hass="${0}" .preferences="${0}" .info="${0}" @value-changed="${0}"></ha-energy-solar-settings>`),this.hass,this._preferences,this._info,this._prefsChanged):2===this._step?(0,r.qy)(x||(x=O`<ha-energy-battery-settings .hass="${0}" .preferences="${0}" @value-changed="${0}"></ha-energy-battery-settings>`),this.hass,this._preferences,this._prefsChanged):3===this._step?(0,r.qy)(C||(C=O`<ha-energy-gas-settings .hass="${0}" .preferences="${0}" @value-changed="${0}"></ha-energy-gas-settings>`),this.hass,this._preferences,this._prefsChanged):4===this._step?(0,r.qy)(w||(w=O`<ha-energy-water-settings .hass="${0}" .preferences="${0}" @value-changed="${0}"></ha-energy-water-settings>`),this.hass,this._preferences,this._prefsChanged):(0,r.qy)(k||(k=O`<ha-energy-device-settings .hass="${0}" .preferences="${0}" @value-changed="${0}"></ha-energy-device-settings>`),this.hass,this._preferences,this._prefsChanged),this._step>0?(0,r.qy)(z||(z=O`<ha-button appearance="plain" @click="${0}">${0}</ha-button>`),this._back,this.hass.localize("ui.panel.energy.setup.back")):(0,r.qy)(q||(q=O`<div></div>`)),this._step<4?(0,r.qy)(A||(A=O`<ha-button @click="${0}">${0}</ha-button>`),this._next,this.hass.localize("ui.panel.energy.setup.next")):(0,r.qy)(D||(D=O`<ha-button @click="${0}"> ${0} </ha-button>`),this._setupDone,this.hass.localize("ui.panel.energy.setup.done")))}async _fetchconfig(){this._info=await(0,h.BV)(this.hass)}_prefsChanged(e){this._preferences=e.detail.value}_back(){0!==this._step&&this._step--}_next(){5!==this._step&&this._step++}async _setupDone(){if(this._preferences)if(0!==this._preferences.device_consumption.length||0!==this._preferences.energy_sources.length){try{this._preferences=await(0,h.WN)(this.hass,this._preferences)}catch(e){(0,c.showAlertDialog)(this,{title:`Failed to save config: ${e.message}`})}(0,o.r)(this,"reload-energy-panel")}else(0,c.showAlertDialog)(this,{title:this.hass.localize("ui.panel.energy.setup.no_statistics_selected_title"),text:this.hass.localize("ui.panel.energy.setup.no_statistics_selected_description")})}static get styles(){return[l.RF,(0,r.AH)(N||(N=O`:host{display:block;padding:16px;max-width:700px;margin:0 auto}ha-button{margin-top:8px}.buttons{display:flex;justify-content:space-between}`))]}constructor(...e){super(...e),this._step=0,this._preferences={energy_sources:[],device_consumption:[],device_consumption_water:[]}}}(0,i.Cg)([(0,a.MZ)({attribute:!1})],R.prototype,"hass",void 0),(0,i.Cg)([(0,a.MZ)({attribute:!1})],R.prototype,"lovelace",void 0),(0,i.Cg)([(0,a.wk)()],R.prototype,"_info",void 0),(0,i.Cg)([(0,a.wk)()],R.prototype,"_step",void 0),(0,i.Cg)([(0,a.wk)()],R.prototype,"_preferences",void 0),R=(0,i.Cg)([(0,a.EM)("energy-setup-wizard-card")],R),n()}catch($){n($)}})},75751:function(e,t,s){s.d(t,{u:function(){return o}});s(16280),s(45367),s(92731),s(62953);var n=s(5055),i=s(42017),r=s(63937);const a=(e,t,s)=>{const n=new Map;for(let i=t;i<=s;i++)n.set(e[i],i);return n},o=(0,i.u$)(class extends i.WL{dt(e,t,s){let n;void 0===s?s=t:void 0!==t&&(n=t);const i=[],r=[];let a=0;for(const o of e)i[a]=n?n(o,a):a,r[a]=s(o,a),a++;return{values:r,keys:i}}render(e,t,s){return this.dt(e,t,s).values}update(e,[t,s,i]){var o;const h=(0,r.cN)(e),{values:c,keys:l}=this.dt(t,s,i);if(!Array.isArray(h))return this.ut=l,c;const u=null!==(o=this.ut)&&void 0!==o?o:this.ut=[],p=[];let g,f,d=0,_=h.length-1,y=0,v=c.length-1;for(;d<=_&&y<=v;)if(null===h[d])d++;else if(null===h[_])_--;else if(u[d]===l[y])p[y]=(0,r.lx)(h[d],c[y]),d++,y++;else if(u[_]===l[v])p[v]=(0,r.lx)(h[_],c[v]),_--,v--;else if(u[d]===l[v])p[v]=(0,r.lx)(h[d],c[v]),(0,r.Dx)(e,p[v+1],h[d]),d++,v--;else if(u[_]===l[y])p[y]=(0,r.lx)(h[_],c[y]),(0,r.Dx)(e,h[d],h[_]),_--,y++;else if(void 0===g&&(g=a(l,y,v),f=a(u,d,_)),g.has(u[d]))if(g.has(u[_])){const t=f.get(l[y]),s=void 0!==t?h[t]:null;if(null===s){const t=(0,r.Dx)(e,h[d]);(0,r.lx)(t,c[y]),p[y]=t}else p[y]=(0,r.lx)(s,c[y]),(0,r.Dx)(e,h[d],s),h[t]=null;y++}else(0,r.KO)(h[_]),_--;else(0,r.KO)(h[d]),d++;for(;y<=v;){const t=(0,r.Dx)(e,p[v+1]);(0,r.lx)(t,c[y]),p[y++]=t}for(;d<=_;){const e=h[d++];null!==e&&(0,r.KO)(e)}return this.ut=l,(0,r.mY)(e,p),n.c0}constructor(e){if(super(e),e.type!==i.OA.CHILD)throw Error("repeat() can only be used in text expressions")}})}}]);