iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 15.9 kB
JavaScript
export const __rspack_esm_id=38108;export const __rspack_esm_ids=[38108];export const __webpack_modules__={90409(e,t,n){n.d(t,{A:()=>i});n(18111),n(61701);function i(e){const t=e.split(":").map(Number);return 3600*t[0]+60*t[1]+t[2]}},4423(e,t,n){n.d(t,{B:()=>l,r:()=>o});n(44114),n(18111),n(13579),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698);var i=n(44537),s=n(71727),r=n(28455);const a=e=>{if(void 0!==e)return null===e?new Set([null]):new Set((0,i.e)(e))},o=(e,t)=>{const n=t.domain?new Set((0,i.e)(t.domain)):void 0,o=t.hidden_domains?new Set((0,i.e)(t.hidden_domains)):void 0,l=t.device_class?new Set((0,i.e)(t.device_class)):void 0,h=a(t.floor),d=a(t.area),c=a(t.device),u=t.entity_category?new Set((0,i.e)(t.entity_category)):void 0,b=t.label?new Set((0,i.e)(t.label)):void 0,m=t.hidden_platform?new Set((0,i.e)(t.hidden_platform)):void 0;return t=>{const i=e.states[t];if(!i)return!1;if(n||o){const e=(0,s.m)(t);if(n&&!n.has(e))return!1;if(o&&o.has(e))return!1}if(l){const e=i.attributes.device_class||"none";if(!l.has(e))return!1}const{area:a,floor:p,device:g,entity:v}=(0,r.ln)(i,e.entities,e.devices,e.areas,e.floors);if(v&&v.hidden)return!1;if(h){const e=p?.floor_id??null;if(!h.has(e))return!1}if(d){const e=a?.area_id??null;if(!d.has(e))return!1}if(c){const e=g?.id??null;if(!c.has(e))return!1}if(b){if(!v)return!1;if(!v.labels.some(e=>b.has(e)))return!1}if(u){const e=v?.entity_category||"none";if(!u.has(e))return!1}if(m){if(!v)return!1;if(v.platform&&m.has(v.platform))return!1}return!0}},l=(e,t)=>{const n=new Set,i=[];for(const s of t)for(const t of e)s(t)&&!n.has(t)&&(n.add(t),i.push(t));return i}},17399(e,t,n){n.d(t,{W:()=>i});const i=e=>{const t=e.trim();let n,i;return t.endsWith("ms")?(n=parseFloat(t.slice(0,-2)),i=1):t.endsWith("s")?(n=parseFloat(t.slice(0,-1)),i=1e3):(n=parseFloat(t),i=1),!isFinite(n)||n<0?0:n*i}},58548(e,t,n){n.d(t,{A:()=>s});const i=e=>{const t=parseFloat(e);if(isNaN(t))throw new Error(`${e} is not a number`);return t};function s(e){if(!e)return null;try{if(e.endsWith("%"))return{w:100,h:i(e.slice(0,-1))};const t=e.replace(":","x").split("x");return 0===t.length?null:1===t.length?{w:i(t[0]),h:1}:{w:i(t[0]),h:i(t[1])}}catch(e){}return null}},60353(e,t,n){n.d(t,{u:()=>i});class i{start(e){const t=Date.now();this._startY=e,this._startTime=t,this._lastY=e,this._lastTime=t,this._delta=0}move(e){const t=Date.now();return this._delta=this._startY-e,this._lastY=e,this._lastTime=t,this._delta}end(){const e=this.getVelocity(),t=Math.abs(e)>this._velocityThreshold;return{velocity:e,delta:this._delta,isSwipe:t,isDownwardSwipe:e>0}}getDelta(){return this._delta}getVelocity(){if(Date.now()-this._lastTime>=this._movementTimeThreshold)return 0;const e=this._lastTime-this._startTime;return e>0?(this._lastY-this._startY)/e:0}reset(){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0}constructor(e={}){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=e.velocitySwipeThreshold??.5,this._movementTimeThreshold=e.movementTimeThreshold??100}}},89300(e,t,n){n.a(e,async function(e,t){try{var i=n(62826),s=n(5124),r=n(22441),a=n(6412),o=n(18350),l=n(65829),h=(n(67094),e([o,l]));[o,l]=h.then?(await h)():h;const d="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",c="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z";class u extends s.WF{render(){const e=this.progress||this._result?"accent":this.appearance;return s.qy` <ha-button .appearance="${e}" .disabled="${this.disabled}" .loading="${this.progress}" .variant="${"success"===this._result?"success":"error"===this._result?"danger":this.variant}" class="${(0,a.H)({result:!!this._result,success:"success"===this._result,error:"error"===this._result})}"> ${this.iconPath?s.qy`<ha-svg-icon .path="${this.iconPath}" slot="start"></ha-svg-icon>`:s.s6} <slot>${this.label}</slot> </ha-button> ${this._result?s.qy` <div class="progress"> ${"success"===this._result?s.qy`<ha-svg-icon .path="${c}"></ha-svg-icon>`:"error"===this._result?s.qy`<ha-svg-icon .path="${d}"></ha-svg-icon>`:s.s6} </div> `:s.s6} `}actionSuccess(){this._setResult("success")}actionError(){this._setResult("error")}_setResult(e){this._result=e,setTimeout(()=>{this._result=void 0},2e3)}constructor(...e){super(...e),this.disabled=!1,this.progress=!1,this.appearance="accent",this.variant="brand"}}u.styles=s.AH`:host{outline:0;display:inline-block;position:relative}:host([progress]){pointer-events:none}.progress{bottom:0;display:flex;justify-content:center;align-items:center;position:absolute;top:0;width:100%}ha-button{width:100%}ha-button.result::part(caret),ha-button.result::part(end),ha-button.result::part(label),ha-button.result::part(spinner),ha-button.result::part(start){visibility:hidden}:host([appearance=brand]) ha-svg-icon{color:var(--white-color)}`,(0,i.Cg)([(0,r.MZ)()],u.prototype,"label",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],u.prototype,"progress",void 0),(0,i.Cg)([(0,r.MZ)()],u.prototype,"appearance",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"iconPath",void 0),(0,i.Cg)([(0,r.MZ)()],u.prototype,"variant",void 0),(0,i.Cg)([(0,r.wk)()],u.prototype,"_result",void 0),u=(0,i.Cg)([(0,r.EM)("ha-progress-button")],u),t()}catch(e){t(e)}})},38395(e,t,n){n.d(t,{gh:()=>l,kU:()=>h,q:()=>o});var i=n(35518),s=n(62384),r=n(61557);function a(e){return document.cookie=`ingress_session=${e};path=/api/hassio_ingress/;SameSite=Strict${"https:"===location.protocol?";Secure":""}`,e}const o=async e=>{if((0,s.v)(e.config.version,2021,2,4)){return a((await e.callWS({type:"supervisor/api",endpoint:"/ingress/session",method:"post"})).session)}return a((await e.callApi("POST","hassio/ingress/session")).data.session)},l=e=>(0,i.X)(e,"_ingressPanelInfo",async e=>(await(0,r.uw)(e,{endpoint:"/ingress/panels"})).panels),h=async(e,t)=>{(0,s.v)(e.config.version,2021,2,4)?await e.callWS({type:"supervisor/api",endpoint:"/ingress/validate_session",method:"post",data:{session:t}}):await e.callApi("POST","hassio/ingress/validate_session",{session:t})}},2928(e,t,n){n.a(e,async function(e,i){try{n.d(t,{S5:()=>d,bG:()=>l,mE:()=>h});n(74423);if(66649!=n.j)var s=n(69093);var r=n(24673),a=e([r]);r=(a.then?(await a)():a)[0];const o={alarm_control_panel:()=>n.e(67039).then(n.bind(n,8866)),automation:()=>n.e(59454).then(n.bind(n,68845)),camera:()=>n.e(65742).then(n.bind(n,16349)),climate:()=>n.e(99928).then(n.bind(n,14667)),configurator:()=>n.e(74124).then(n.bind(n,34439)),conversation:()=>Promise.all([n.e(28845),n.e(14150)]).then(n.bind(n,32421)),counter:()=>n.e(60069).then(n.bind(n,40932)),cover:()=>Promise.all([n.e(24484),n.e(63608)]).then(n.bind(n,21771)),date:()=>n.e(85659).then(n.bind(n,54358)),datetime:()=>Promise.all([n.e(99194),n.e(38124)]).then(n.bind(n,58919)),fan:()=>n.e(790).then(n.bind(n,18133)),group:()=>Promise.all([n.e(73065),n.e(68616)]).then(n.bind(n,72315)),humidifier:()=>n.e(92523).then(n.bind(n,75417)),image:()=>n.e(75226).then(n.bind(n,77249)),input_boolean:()=>n.e(64656).then(n.bind(n,62387)),input_datetime:()=>n.e(76203).then(n.bind(n,15366)),lawn_mower:()=>n.e(2302).then(n.bind(n,69389)),light:()=>Promise.all([n.e(24484),n.e(63373)]).then(n.bind(n,9884)),lock:()=>n.e(17910).then(n.bind(n,54101)),media_player:()=>n.e(68507).then(n.bind(n,70294)),person:()=>Promise.all([n.e(87451),n.e(12122),n.e(76420)]).then(n.bind(n,68047)),remote:()=>n.e(38545).then(n.bind(n,36872)),script:()=>n.e(75598).then(n.bind(n,46557)),siren:()=>n.e(92950).then(n.bind(n,27029)),sun:()=>n.e(39791).then(n.bind(n,4178)),switch:()=>n.e(14239).then(n.bind(n,31618)),time:()=>n.e(37288).then(n.bind(n,80731)),timer:()=>n.e(2202).then(n.bind(n,97889)),update:()=>Promise.all([n.e(79996),n.e(98672)]).then(n.bind(n,1843)),vacuum:()=>n.e(51122).then(n.bind(n,11113)),valve:()=>Promise.all([n.e(24484),n.e(95351)]).then(n.bind(n,5610)),water_heater:()=>n.e(55684).then(n.bind(n,1199)),weather:()=>Promise.all([n.e(66432),n.e(67237)]).then(n.bind(n,84932))},l=e=>{const t=(0,s.t)(e);return h(t)},h=e=>r.gs.includes(e)?e:r.oF.includes(e)?"hidden":"default",d=e=>{e in o&&o[e]()};i()}catch(e){i(e)}})},21018(e,t,n){n.a(e,async function(e,i){try{n.d(t,{YH:()=>d,hZ:()=>h,ww:()=>c});n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698);var s=n(67066),r=n(34128),a=e([s]);s=(a.then?(await a)():a)[0];const o=new Set(["error","entity"]),l={"entity-filter":()=>n.e(4994).then(n.bind(n,95417)),shortcut:()=>n.e(76612).then(n.bind(n,32175)),"state-label":()=>n.e(52396).then(n.bind(n,22087)),"power-total":()=>Promise.all([n.e(92610),n.e(77183),n.e(28696)]).then(n.bind(n,12150)),"gas-total":()=>Promise.all([n.e(92610),n.e(77183),n.e(72892)]).then(n.bind(n,70346)),"water-total":()=>Promise.all([n.e(92610),n.e(77183),n.e(33194)]).then(n.bind(n,61844))},h=e=>(0,r.Vd)("badge",e,o,l,void 0,"entity"),d=e=>(0,r.Ue)("badge",e,o,l,void 0,"entity"),c=e=>(0,r.gh)(e,"badge",o,l);i()}catch(e){i(e)}})},8349(e,t,n){n.a(e,async function(e,i){try{n.d(t,{MJ:()=>f,dY:()=>P,te:()=>w});n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698);var s=n(85240),r=n(97735),a=n(40205),o=n(45309),l=n(5253),h=n(63577),d=n(17747),c=n(203),u=n(68102),b=n(81643),m=n(89969),p=n(75201),g=n(34128),v=e([s,r,a,o,l,h,d,c,u,b,m,p]);[s,r,a,o,l,h,d,c,u,b,m,p]=v.then?(await v)():v;const y=new Set(["entity","entities","button","entity-button","glance","grid","section","light","sensor","thermostat","weather-forecast","tile","heading"]),_={"alarm-panel":()=>n.e(73842).then(n.bind(n,84329)),area:()=>n.e(50235).then(n.bind(n,17366)),calendar:()=>Promise.all([n.e(79996),n.e(10147),n.e(82752),n.e(83312),n.e(5012)]).then(n.bind(n,68159)),conditional:()=>n.e(77388).then(n.bind(n,51527)),"empty-state":()=>n.e(48285).then(n.bind(n,90476)),"energy-compare":()=>Promise.all([n.e(92610),n.e(77183),n.e(73618)]).then(n.bind(n,62284)),"energy-carbon-consumed-gauge":()=>Promise.all([n.e(92610),n.e(77183),n.e(77735)]).then(n.bind(n,57545)),"energy-date-selection":()=>Promise.all([n.e(92610),n.e(80827),n.e(16704),n.e(77183),n.e(7256),n.e(71483)]).then(n.bind(n,56342)),"energy-devices-graph":()=>Promise.all([n.e(92610),n.e(37552),n.e(1872),n.e(5520),n.e(77183),n.e(19260),n.e(24404)]).then(n.bind(n,78231)),"energy-devices-detail-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(39565)]).then(n.bind(n,71209)),"energy-distribution":()=>Promise.all([n.e(92610),n.e(77183),n.e(46239)]).then(n.bind(n,30961)),"energy-gas-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(43881)]).then(n.bind(n,99389)),"energy-water-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(6171)]).then(n.bind(n,62743)),"energy-grid-neutrality-gauge":()=>Promise.all([n.e(92610),n.e(77183),n.e(32527)]).then(n.bind(n,80449)),"energy-grid-balance":()=>Promise.all([n.e(92610),n.e(77183),n.e(75246)]).then(n.bind(n,76331)),"energy-solar-consumed-gauge":()=>Promise.all([n.e(92610),n.e(77183),n.e(22629)]).then(n.bind(n,89979)),"energy-self-sufficiency-gauge":()=>Promise.all([n.e(92610),n.e(77183),n.e(35546)]).then(n.bind(n,48196)),"energy-solar-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(76285)]).then(n.bind(n,32185)),"energy-sources-table":()=>Promise.all([n.e(92610),n.e(77183),n.e(97870)]).then(n.bind(n,24408)),"energy-usage-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(93507)]).then(n.bind(n,14207)),"energy-sankey":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(72701),n.e(88156),n.e(77183),n.e(19260),n.e(48347),n.e(58597)]).then(n.bind(n,31396)),"water-sankey":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(72701),n.e(88156),n.e(77183),n.e(19260),n.e(48347),n.e(85069)]).then(n.bind(n,41436)),"water-flow-sankey":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(72701),n.e(88156),n.e(77183),n.e(19260),n.e(48347),n.e(37248)]).then(n.bind(n,34499)),"power-sources-graph":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(1872),n.e(9970),n.e(24060),n.e(77183),n.e(19260),n.e(24301),n.e(66471)]).then(n.bind(n,40235)),"power-sankey":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(72701),n.e(88156),n.e(77183),n.e(19260),n.e(48347),n.e(67518)]).then(n.bind(n,59277)),"entity-filter":()=>n.e(99104).then(n.bind(n,6275)),error:()=>Promise.resolve().then(n.bind(n,4397)),"home-summary":()=>Promise.all([n.e(92610),n.e(77183),n.e(3650),n.e(18673)]).then(n.bind(n,51687)),shortcut:()=>n.e(73044).then(n.bind(n,30175)),"discovered-devices":()=>n.e(64522).then(n.bind(n,38865)),repairs:()=>n.e(31854).then(n.bind(n,84029)),updates:()=>n.e(8550).then(n.bind(n,71154)),gauge:()=>n.e(21727).then(n.bind(n,91874)),"history-graph":()=>Promise.all([n.e(37552),n.e(77072),n.e(53771),n.e(1872),n.e(9970),n.e(24060),n.e(19260),n.e(46866),n.e(83779)]).then(n.bind(n,41544)),"horizontal-stack":()=>n.e(175).then(n.bind(n,63218)),distribution:()=>n.e(19472).then(n.bind(n,62707)),humidifier:()=>n.e(38861).then(n.bind(n,86145)),iframe:()=>n.e(44722).then(n.bind(n,56393)),logbook:()=>Promise.all([n.e(82333),n.e(23954)]).then(n.bind(n,42526)),map:()=>Promise.all([n.e(87451),n.e(12122),n.e(21742)]).then(n.bind(n,22845)),markdown:()=>n.e(44619).then(n.bind(n,67334)),clock:()=>n.e(11546).then(n.bind(n,56833)),"media-control":()=>Promise.all([n.e(87941),n.e(37136)]).then(n.bind(n,92723)),"picture-elements":()=>Promise.all([n.e(99143),n.e(66990),n.e(37848)]).then(n.bind(n,63933)),"picture-entity":()=>Promise.all([n.e(99143),n.e(48412)]).then(n.bind(n,86063)),"picture-glance":()=>Promise.all([n.e(99143),n.e(37855)]).then(n.bind(n,78602)),picture:()=>n.e(85030).then(n.bind(n,30789)),"plant-status":()=>n.e(97524).then(n.bind(n,89759)),"recovery-mode":()=>Promise.all([n.e(86269),n.e(20295)]).then(n.bind(n,93132)),"toggle-group":()=>n.e(87764).then(n.bind(n,5023)),"todo-list":()=>n.e(31355).then(n.bind(n,62134)),"shopping-list":()=>Promise.all([n.e(31355),n.e(89235)]).then(n.bind(n,36606)),starting:()=>n.e(31946).then(n.bind(n,88785)),"statistics-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(24301),n.e(42568)]).then(n.bind(n,3515)),statistic:()=>Promise.all([n.e(92610),n.e(77183),n.e(69315)]).then(n.bind(n,89029)),"vertical-stack":()=>n.e(55989).then(n.bind(n,33204))},f=e=>(0,g.Vd)("card",e,y,_,void 0,void 0),w=e=>(0,g.Ue)("card",e,y,_,void 0,void 0),P=e=>(0,g.gh)(e,"card",y,_);i()}catch(e){i(e)}})},83938(e,t,n){n.d(t,{l:()=>a,x:()=>r});var i=n(34128);const s={picture:()=>n.e(17813).then(n.bind(n,97588)),buttons:()=>n.e(16700).then(n.bind(n,72791)),graph:()=>n.e(33427).then(n.bind(n,67806))},r=e=>(0,i.Ue)("header-footer",e,void 0,s,void 0,void 0),a=e=>(0,i.gh)(e,"header-footer",void 0,s)},84043(e,t,n){n.a(e,async function(e,i){try{n.d(t,{d:()=>b});n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698);var s=n(98743),r=(n(16732),n(9578)),a=n(51007),o=n(37696),l=n(10792),h=n(14097),d=n(34128),c=e([s,r,a,o,l,h]);[s,r,a,o,l,h]=c.then?(await c)():c;const u=new Set(["conditional","icon","image","service-button","state-badge","state-icon","state-label"]),b=e=>("action-button"===e.type&&(e={...e,type:"service-button"}),(0,d.Ue)("element",e,u));i()}catch(e){i(e)}})},33963(e,t,n){n.a(e,async function(e,i){try{if(n.r(t),n.d(t,{createBadgeElement:()=>o.YH,createCardElement:()=>l.te,createHeaderFooterElement:()=>h.x,createHuiElement:()=>d.d,createRowElement:()=>c.T,importMoreInfoControl:()=>a.S5,showAlertDialog:()=>r.showAlertDialog,showConfirmationDialog:()=>r.dk,showEnterCodeDialog:()=>s.H,showPromptDialog:()=>r.an}),59509==n.j)var s=n(48927);var r=n(65063),a=n(2928),o=n(21018),l=n(8349),h=n(83938),d=n(84043),c=n(94225),u=e([a,o,l,d,c]);[a,o,l,d,c]=u.then?(await u)():u,i()}catch(e){i(e)}})}};