iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 10 kB
JavaScript
export const __webpack_ids__=["95346"];export const __webpack_modules__={50634:function(e,t,i){i.r(t),i.d(t,{HaQrCode:()=>d});var r=i(44249),a=i(72621),n=(i(9359),i(70104),i(57243)),o=i(15093),s=i(54647),c=(i(99426),i(11259));let d=(0,r.Z)([(0,o.Mo)("ha-qr-code")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)()],key:"data",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"error-correction-level"})],key:"errorCorrectionLevel",value:()=>"medium"},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"width",value:()=>4},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"scale",value:()=>4},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"margin",value:()=>4},{kind:"field",decorators:[(0,o.Cb)({attribute:!1,type:Number})],key:"maskPattern",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"center-image"})],key:"centerImage",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,o.IO)("canvas")],key:"_canvas",value:void 0},{kind:"method",key:"willUpdate",value:function(e){(0,a.Z)(i,"willUpdate",this,3)([e]),(e.has("data")||e.has("scale")||e.has("width")||e.has("margin")||e.has("maskPattern")||e.has("errorCorrectionLevel"))&&this._error&&(this._error=void 0)}},{kind:"method",key:"updated",value:function(e){const t=this._canvas;if(t&&this.data&&(e.has("data")||e.has("scale")||e.has("width")||e.has("margin")||e.has("maskPattern")||e.has("errorCorrectionLevel")||e.has("centerImage"))){const e=getComputedStyle(this),i=e.getPropertyValue("--rgb-primary-text-color"),r=e.getPropertyValue("--rgb-card-background-color"),a=(0,c.CO)(i.split(",").map((e=>parseInt(e,10)))),n=(0,c.CO)(r.split(",").map((e=>parseInt(e,10))));if(s.toCanvas(t,this.data,{errorCorrectionLevel:this.errorCorrectionLevel||(this.centerImage?"Q":"M"),width:this.width,scale:this.scale,margin:this.margin,maskPattern:this.maskPattern,color:{light:n,dark:a}}).catch((e=>{this._error=e.message})),this.centerImage){const e=this._canvas.getContext("2d"),i=new Image;i.src=this.centerImage,i.onload=()=>{e?.drawImage(i,.375*t.width,.375*t.height,t.width/4,t.height/4)}}}}},{kind:"method",key:"render",value:function(){return this.data?this._error?n.dy`<ha-alert alert-type="error">${this._error}</ha-alert>`:n.dy`<canvas></canvas>`:n.Ld}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:block}`}]}}),n.oi)},57426:function(e,t,i){i.a(e,(async function(e,r){try{i.r(t);var a=i(44249),n=(i(9359),i(70104),i(2060),i(31622),i(57243)),o=i(15093),s=i(36522),c=i(17170),d=(i(7285),i(73729)),h=(i(50634),i(88935)),l=i(76131),f=i(28008),u=e([c]);c=(u.then?(await u)():u)[0];const v="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z";(0,a.Z)([(0,o.Mo)("dialog-matter-manage-fabrics")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"device_id",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_nodeDiagnostics",value:void 0},{kind:"method",key:"showDialog",value:async function(e){this.device_id=e.device_id,this._fetchNodeDetails()}},{kind:"method",key:"render",value:function(){return this.device_id?n.dy` <ha-dialog open hideActions ="${this.closeDialog}" .heading="${(0,d.i)(this.hass,this.hass.localize("ui.panel.config.matter.manage_fabrics.title"))}"> <p> ${this.hass.localize("ui.panel.config.matter.manage_fabrics.fabrics")} </p> ${this._nodeDiagnostics?n.dy`<mwc-list> ${this._nodeDiagnostics.active_fabrics.map((e=>n.dy`<ha-list-item noninteractive .hasMeta="${this._nodeDiagnostics.available&&e.fabric_index!==this._nodeDiagnostics.active_fabric_index}">${e.vendor_name||e.fabric_label||e.vendor_id} <ha-icon-button ="${this._removeFabric}" slot="meta" .fabric="${e}" .path="${v}"></ha-icon-button> </ha-list-item>`))} </mwc-list>`:n.dy`<div class="center"> <ha-spinner></ha-spinner> </div>`} </ha-dialog> `:n.Ld}},{kind:"method",key:"_fetchNodeDetails",value:async function(){if(this.device_id)try{this._nodeDiagnostics=await(0,h.uV)(this.hass,this.device_id)}catch(e){this._nodeDiagnostics=void 0}}},{kind:"method",key:"_removeFabric",value:async function(e){const t=e.target.fabric;if(this._nodeDiagnostics.active_fabric_index===t.fabric_index)return;const i=t.vendor_name||t.fabric_label||t.vendor_id.toString();if(await(0,l.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.matter.manage_fabrics.remove_fabric_confirm_header",{fabric:i}),text:this.hass.localize("ui.panel.config.matter.manage_fabrics.remove_fabric_confirm_text",{fabric:i}),warning:!0}))try{await(0,h.nJ)(this.hass,this.device_id,t.fabric_index),this._fetchNodeDetails()}catch(e){(0,l.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.matter.manage_fabrics.remove_fabric_failed_header",{fabric:i}),text:this.hass.localize("ui.panel.config.matter.manage_fabrics.remove_fabric_failed_text")})}}},{kind:"method",key:"closeDialog",value:function(){this.device_id=void 0,this._nodeDiagnostics=void 0,(0,s.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"get",static:!0,key:"styles",value:function(){return[f.yu,n.iv`ha-dialog{--dialog-content-padding:0;--mdc-list-side-padding:24px;--mdc-list-side-padding-right:16px;--mdc-list-item-meta-size:48px}p{margin:8px 24px}.center{display:flex;align-items:center;justify-content:center}`]}}]}}),n.oi);r()}catch(e){r(e)}}))},78344:function(e){var t=TypeError;e.exports=function(e){if("string"==typeof e)return e;throw new t("Argument is not a string")}},87265:function(e,t,i){var r=i(61896),a=String,n=TypeError;e.exports=function(e){if(void 0===e||r(e))return e;throw new n(a(e)+" is not an object or undefined")}},87038:function(e,t,i){var r=i(59069),a=TypeError;e.exports=function(e){if("Uint8Array"===r(e))return e;throw new a("Argument is not an Uint8Array")}},15419:function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=t+"+/",r=t+"-_",a=function(e){for(var t={},i=0;i<64;i++)t[e.charAt(i)]=i;return t};e.exports={i2c:i,c2i:a(i),i2cUrl:r,c2iUrl:a(r)}},93474:function(e){var t=TypeError;e.exports=function(e){var i=e&&e.alphabet;if(void 0===i||"base64"===i||"base64url"===i)return i||"base64";throw new t("Incorrect `alphabet` option")}},47057:function(e,t,i){var r=i(1569),a=i(72878),n=i(87265),o=i(78344),s=i(39129),c=i(15419),d=i(93474),h=i(38511),l=c.c2i,f=c.c2iUrl,u=r.SyntaxError,v=r.TypeError,g=a("".charAt),m=function(e,t){for(var i=e.length;t<i;t++){var r=g(e,t);if(" "!==r&&"\t"!==r&&"\n"!==r&&"\f"!==r&&"\r"!==r)break}return t},b=function(e,t,i){var r=e.length;r<4&&(e+=2===r?"AA":"A");var a=(t[g(e,0)]<<18)+(t[g(e,1)]<<12)+(t[g(e,2)]<<6)+t[g(e,3)],n=[a>>16&255,a>>8&255,255&a];if(2===r){if(i&&0!==n[1])throw new u("Extra bits");return[n[0]]}if(3===r){if(i&&0!==n[2])throw new u("Extra bits");return[n[0],n[1]]}return n},p=function(e,t,i){for(var r=t.length,a=0;a<r;a++)e[i+a]=t[a];return i+r};e.exports=function(e,t,i,r){o(e),n(t);var a="base64"===d(t)?l:f,c=t?t.lastChunkHandling:void 0;if(void 0===c&&(c="loose"),"loose"!==c&&"strict"!==c&&"stop-before-partial"!==c)throw new v("Incorrect `lastChunkHandling` option");i&&h(i.buffer);var y=i||[],_=0,k=0,w="",x=0;if(r)for(;;){if((x=m(e,x))===e.length){if(w.length>0){if("stop-before-partial"===c)break;if("loose"!==c)throw new u("Missing padding");if(1===w.length)throw new u("Malformed padding: exactly one additional character");_=p(y,b(w,a,!1),_)}k=e.length;break}var A=g(e,x);if(++x,"="===A){if(w.length<2)throw new u("Padding is too early");if(x=m(e,x),2===w.length){if(x===e.length){if("stop-before-partial"===c)break;throw new u("Malformed padding: only one =")}"="===g(e,x)&&(++x,x=m(e,x))}if(x<e.length)throw new u("Unexpected character after padding");_=p(y,b(w,a,"strict"===c),_),k=e.length;break}if(!s(a,A))throw new u("Unexpected character");var C=r-_;if(1===C&&2===w.length||2===C&&3===w.length)break;if(4===(w+=A).length&&(_=p(y,b(w,a,!1),_),w="",k=x,_===r))break}return{bytes:y,read:k,written:_}}},35303:function(e,t,i){var r=i(1569),a=i(72878),n=r.Uint8Array,o=r.SyntaxError,s=r.parseInt,c=Math.min,d=/[^\da-f]/i,h=a(d.exec),l=a("".slice);e.exports=function(e,t){var i=e.length;if(i%2!=0)throw new o("String should be an even number of characters");for(var r=t?c(t.length,i/2):i/2,a=t||new n(r),f=0,u=0;u<r;){var v=l(e,f,f+=2);if(h(d,v))throw new o("String should only contain hex characters");a[u++]=s(v,16)}return{bytes:a,read:f}}},21917:function(e,t,i){var r=i(40810),a=i(1569),n=i(47057),o=i(87038);a.Uint8Array&&r({target:"Uint8Array",proto:!0},{setFromBase64:function(e){o(this);var t=n(e,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:t.read,written:t.written}}})},56193:function(e,t,i){var r=i(40810),a=i(1569),n=i(78344),o=i(87038),s=i(38511),c=i(35303);a.Uint8Array&&r({target:"Uint8Array",proto:!0},{setFromHex:function(e){o(this),n(e),s(this.buffer);var t=c(e,this).read;return{read:t,written:t/2}}})},25020:function(e,t,i){var r=i(40810),a=i(1569),n=i(72878),o=i(87265),s=i(87038),c=i(38511),d=i(15419),h=i(93474),l=d.i2c,f=d.i2cUrl,u=n("".charAt);a.Uint8Array&&r({target:"Uint8Array",proto:!0},{toBase64:function(){var e=s(this),t=arguments.length?o(arguments[0]):void 0,i="base64"===h(t)?l:f,r=!!t&&!!t.omitPadding;c(this.buffer);for(var a,n="",d=0,v=e.length,g=function(e){return u(i,a>>6*e&63)};d+2<v;d+=3)a=(e[d]<<16)+(e[d+1]<<8)+e[d+2],n+=g(3)+g(2)+g(1)+g(0);return d+2===v?(a=(e[d]<<16)+(e[d+1]<<8),n+=g(3)+g(2)+g(1)+(r?"":"=")):d+1===v&&(a=e[d]<<16,n+=g(3)+g(2)+(r?"":"==")),n}})},86913:function(e,t,i){var r=i(40810),a=i(1569),n=i(72878),o=i(87038),s=i(38511),c=n(1..toString);a.Uint8Array&&r({target:"Uint8Array",proto:!0},{toHex:function(){o(this),s(this.buffer);for(var e="",t=0,i=this.length;t<i;t++){var r=c(this[t],16);e+=1===r.length?"0"+r:r}return e}})}};
//# sourceMappingURL=95346.f177f0287674181e.js.map