UNPKG

iobroker.lovelace

Version:

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

1 lines 17.5 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[38108],{90409:function(e,t,n){n.d(t,{A:function(){return i}});n(18111),n(61701);function i(e){const t=e.split(":").map(Number);return 3600*t[0]+60*t[1]+t[2]}},4423:function(e,t,n){n.d(t,{B:function(){return l},r:function(){return a}});n(44114),n(18111),n(13579),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(62953);var i=n(44537),r=n(71727),s=n(28455);const o=e=>{if(void 0!==e)return null===e?new Set([null]):new Set((0,i.e)(e))},a=(e,t)=>{const n=t.domain?new Set((0,i.e)(t.domain)):void 0,a=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=o(t.floor),d=o(t.area),c=o(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||a){const e=(0,r.m)(t);if(n&&!n.has(e))return!1;if(a&&a.has(e))return!1}if(l){const e=i.attributes.device_class||"none";if(!l.has(e))return!1}const{area:o,floor:p,device:g,entity:f}=(0,s.ln)(i,e.entities,e.devices,e.areas,e.floors);if(f&&f.hidden)return!1;if(h){var v;const e=null!==(v=null==p?void 0:p.floor_id)&&void 0!==v?v:null;if(!h.has(e))return!1}if(d){var y;const e=null!==(y=null==o?void 0:o.area_id)&&void 0!==y?y:null;if(!d.has(e))return!1}if(c){var _;const e=null!==(_=null==g?void 0:g.id)&&void 0!==_?_:null;if(!c.has(e))return!1}if(b){if(!f)return!1;if(!f.labels.some(e=>b.has(e)))return!1}if(u){const e=(null==f?void 0:f.entity_category)||"none";if(!u.has(e))return!1}if(m){if(!f)return!1;if(f.platform&&m.has(f.platform))return!1}return!0}},l=(e,t)=>{const n=new Set,i=[];for(const r of t)for(const t of e)r(t)&&!n.has(t)&&(n.add(t),i.push(t));return i}},17399:function(e,t,n){n.d(t,{W:function(){return i}});n(42762);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:function(e,t,n){n.d(t,{A:function(){return r}});n(16280),n(27495),n(25440);const i=e=>{const t=parseFloat(e);if(isNaN(t))throw new Error(`${e} is not a number`);return t};function r(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(t){}return null}},60353:function(e,t,n){n.d(t,{u:function(){return 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={}){var t,n;this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=null!==(t=e.velocitySwipeThreshold)&&void 0!==t?t:.5,this._movementTimeThreshold=null!==(n=e.movementTimeThreshold)&&void 0!==n?n:100}}},89300:function(e,t,n){n.a(e,async function(e,t){try{n(62953);var i=n(40445),r=n(5124),s=n(67576),o=n(6412),a=n(18350),l=n(65829),h=(n(67094),e([a,l]));[a,l]=h.then?(await h)():h;let d,c,u,b,m,p,g=e=>e;const f="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",v="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z";class y extends r.WF{render(){const e=this.progress||this._result?"accent":this.appearance;return(0,r.qy)(d||(d=g` <ha-button .appearance="${0}" .disabled="${0}" .loading="${0}" .variant="${0}" class="${0}"> ${0} <slot>${0}</slot> </ha-button> ${0} `),e,this.disabled,this.progress,"success"===this._result?"success":"error"===this._result?"danger":this.variant,(0,o.H)({result:!!this._result,success:"success"===this._result,error:"error"===this._result}),this.iconPath?(0,r.qy)(c||(c=g`<ha-svg-icon .path="${0}" slot="start"></ha-svg-icon>`),this.iconPath):r.s6,this.label,this._result?(0,r.qy)(u||(u=g` <div class="progress"> ${0} </div> `),"success"===this._result?(0,r.qy)(b||(b=g`<ha-svg-icon .path="${0}"></ha-svg-icon>`),v):"error"===this._result?(0,r.qy)(m||(m=g`<ha-svg-icon .path="${0}"></ha-svg-icon>`),f):r.s6):r.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"}}y.styles=(0,r.AH)(p||(p=g`: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,s.MZ)()],y.prototype,"label",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"disabled",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],y.prototype,"progress",void 0),(0,i.Cg)([(0,s.MZ)()],y.prototype,"appearance",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"iconPath",void 0),(0,i.Cg)([(0,s.MZ)()],y.prototype,"variant",void 0),(0,i.Cg)([(0,s.wk)()],y.prototype,"_result",void 0),y=(0,i.Cg)([(0,s.EM)("ha-progress-button")],y),t()}catch(d){t(d)}})},38395:function(e,t,n){n.d(t,{gh:function(){return l},kU:function(){return h},q:function(){return a}});n(3362);var i=n(90889),r=n(62384),s=n(61557);function o(e){return document.cookie=`ingress_session=${e};path=/api/hassio_ingress/;SameSite=Strict${"https:"===location.protocol?";Secure":""}`,e}const a=async e=>{if((0,r.v)(e.config.version,2021,2,4)){return o((await e.callWS({type:"supervisor/api",endpoint:"/ingress/session",method:"post"})).session)}return o((await e.callApi("POST","hassio/ingress/session")).data.session)},l=e=>(0,i.X)(e,"_ingressPanelInfo",async e=>(await(0,s.uw)(e,{endpoint:"/ingress/panels"})).panels),h=async(e,t)=>{(0,r.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})}},48927:function(e,t,n){n.d(t,{H:function(){return r}});n(3362),n(62953);var i=n(1087);const r=(e,t)=>new Promise(r=>{const s=t.cancel,o=t.submit;(0,i.r)(e,"show-dialog",{dialogTag:"dialog-enter-code",dialogImport:()=>n.e(29130).then(n.bind(n,24561)),dialogParams:Object.assign(Object.assign({},t),{},{cancel:()=>{r(null),s&&s()},submit:e=>{r(e),o&&o(e)}})})})},2928:function(e,t,n){n.a(e,async function(e,i){try{n.d(t,{S5:function(){return d},bG:function(){return l},mE:function(){return h}});n(74423),n(3362),n(62953);if(66649!=n.j)var r=n(69093);var s=n(24673),o=e([s]);s=(o.then?(await o)():o)[0];const a={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(70876)]).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(24617),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(66139),n.e(70622),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:()=>Promise.all([n.e(21209),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,r.t)(e);return h(t)},h=e=>s.gs.includes(e)?e:s.oF.includes(e)?"hidden":"default",d=e=>{e in a&&a[e]()};i()}catch(a){i(a)}})},21018:function(e,t,n){n.a(e,async function(e,i){try{n.d(t,{YH:function(){return d},hZ:function(){return h},ww:function(){return c}});n(3362),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(62953);var r=n(67066),s=n(34128),o=e([r]);r=(o.then?(await o)():o)[0];const a=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,s.Vd)("badge",e,a,l,void 0,"entity"),d=e=>(0,s.Ue)("badge",e,a,l,void 0,"entity"),c=e=>(0,s.gh)(e,"badge",a,l);i()}catch(a){i(a)}})},8349:function(e,t,n){n.a(e,async function(e,i){try{n.d(t,{MJ:function(){return _},dY:function(){return P},te:function(){return w}});n(3362),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(62953);var r=n(85240),s=n(97735),o=n(40205),a=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),f=e([r,s,o,a,l,h,d,c,u,b,m,p]);[r,s,o,a,l,h,d,c,u,b,m,p]=f.then?(await f)():f;const v=new Set(["entity","entities","button","entity-button","glance","grid","section","light","sensor","thermostat","weather-forecast","tile","heading"]),y={"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(78928),n.e(77183),n.e(7256),n.e(79352)]).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,93590)),"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(66139),n.e(70622),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(56601)]).then(n.bind(n,93132)),"toggle-group":()=>n.e(87764).then(n.bind(n,5023)),"todo-list":()=>Promise.all([n.e(52894),n.e(31355)]).then(n.bind(n,62134)),"shopping-list":()=>Promise.all([n.e(52894),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))},_=e=>(0,g.Vd)("card",e,v,y,void 0,void 0),w=e=>(0,g.Ue)("card",e,v,y,void 0,void 0),P=e=>(0,g.gh)(e,"card",v,y);i()}catch(v){i(v)}})},83938:function(e,t,n){n.d(t,{l:function(){return o},x:function(){return s}});n(3362),n(62953);var i=n(34128);const r={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))},s=e=>(0,i.Ue)("header-footer",e,void 0,r,void 0,void 0),o=e=>(0,i.gh)(e,"header-footer",void 0,r)},84043:function(e,t,n){n.a(e,async function(e,i){try{n.d(t,{d:function(){return b}});n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(62953);var r=n(98743),s=(n(16732),n(9578)),o=n(51007),a=n(37696),l=n(10792),h=n(14097),d=n(34128),c=e([r,s,o,a,l,h]);[r,s,o,a,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=Object.assign(Object.assign({},e),{},{type:"service-button"})),(0,d.Ue)("element",e,u));i()}catch(u){i(u)}})},33963:function(e,t,n){n.a(e,async function(e,i){try{n.r(t),n.d(t,{createBadgeElement:function(){return a.YH},createCardElement:function(){return l.te},createHeaderFooterElement:function(){return h.x},createHuiElement:function(){return d.d},createRowElement:function(){return c.T},importMoreInfoControl:function(){return o.S5},showAlertDialog:function(){return s.showAlertDialog},showConfirmationDialog:function(){return s.dk},showEnterCodeDialog:function(){return r.H},showPromptDialog:function(){return s.an}});var r=n(48927),s=n(65063),o=n(2928),a=n(21018),l=n(8349),h=n(83938),d=n(84043),c=n(94225),u=e([o,a,l,d,c]);[o,a,l,d,c]=u.then?(await u)():u,i()}catch(b){i(b)}})}}]);