iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 5.91 kB
JavaScript
export const __rspack_esm_id=86538;export const __rspack_esm_ids=[86538];export const __webpack_modules__={58548(e,t,n){n.d(t,{A:()=>i});const s=e=>{const t=parseFloat(e);if(isNaN(t))throw new Error(`${e} is not a number`);return t};function i(e){if(!e)return null;try{if(e.endsWith("%"))return{w:100,h:s(e.slice(0,-1))};const t=e.replace(":","x").split("x");return 0===t.length?null:1===t.length?{w:s(t[0]),h:1}:{w:s(t[0]),h:s(t[1])}}catch(e){}return null}},89300(e,t,n){n.a(e,async function(e,t){try{var s=n(62826),i=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 c="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",d="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z";class u extends i.WF{render(){const e=this.progress||this._result?"accent":this.appearance;return i.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?i.qy`<ha-svg-icon .path="${this.iconPath}" slot="start"></ha-svg-icon>`:i.s6} <slot>${this.label}</slot> </ha-button> ${this._result?i.qy` <div class="progress"> ${"success"===this._result?i.qy`<ha-svg-icon .path="${d}"></ha-svg-icon>`:"error"===this._result?i.qy`<ha-svg-icon .path="${c}"></ha-svg-icon>`:i.s6} </div> `:i.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=i.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,s.Cg)([(0,r.MZ)()],u.prototype,"label",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],u.prototype,"progress",void 0),(0,s.Cg)([(0,r.MZ)()],u.prototype,"appearance",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"iconPath",void 0),(0,s.Cg)([(0,r.MZ)()],u.prototype,"variant",void 0),(0,s.Cg)([(0,r.wk)()],u.prototype,"_result",void 0),u=(0,s.Cg)([(0,r.EM)("ha-progress-button")],u),t()}catch(e){t(e)}})},2928(e,t,n){n.a(e,async function(e,s){try{n.d(t,{S5:()=>c,bG:()=>l,mE:()=>h});n(74423);var i=n(69093),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,i.t)(e);return h(t)},h=e=>r.gs.includes(e)?e:r.oF.includes(e)?"hidden":"default",c=e=>{e in o&&o[e]()};s()}catch(e){s(e)}})},84043(e,t,n){n.a(e,async function(e,s){try{n.d(t,{d:()=>p});n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698);var i=n(98743),r=(n(16732),n(9578)),a=n(51007),o=n(37696),l=n(10792),h=n(14097),c=n(34128),d=e([i,r,a,o,l,h]);[i,r,a,o,l,h]=d.then?(await d)():d;const u=new Set(["conditional","icon","image","service-button","state-badge","state-icon","state-label"]),p=e=>("action-button"===e.type&&(e={...e,type:"service-button"}),(0,c.Ue)("element",e,u));s()}catch(e){s(e)}})},33963(e,t,n){n.a(e,async function(e,s){try{n.r(t),n.d(t,{createBadgeElement:()=>o.YH,createCardElement:()=>l.te,createHeaderFooterElement:()=>h.x,createHuiElement:()=>c.d,createRowElement:()=>d.T,importMoreInfoControl:()=>a.S5,showAlertDialog:()=>r.showAlertDialog,showConfirmationDialog:()=>r.dk,showEnterCodeDialog:()=>i.H,showPromptDialog:()=>r.an});var i=n(48927),r=n(65063),a=n(2928),o=n(21018),l=n(8349),h=n(83938),c=n(84043),d=n(94225),u=e([a,o,l,c,d]);[a,o,l,c,d]=u.then?(await u)():u,s()}catch(e){s(e)}})}};