iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 3.64 kB
JavaScript
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[11600],{63130:function(t,a,e){e.d(a,{l:function(){return s}});e(3362);var o=e(50248);const s=async(t,a)=>{var e;if(navigator.clipboard)try{return void(await navigator.clipboard.writeText(t))}catch(r){}const s=a||(null===(e=(0,o.n)())||void 0===e?void 0:e.getRootNode())||document.body,i=document.createElement("textarea");i.value=t,i.setAttribute("readonly",""),i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.opacity="0",s.appendChild(i),i.select(),document.execCommand("copy"),s.removeChild(i)}},80243:function(t,a,e){e.a(t,async function(t,o){try{e.r(a);e(18111),e(61701),e(33110),e(3362),e(27495),e(62953);var s=e(40445),i=e(5124),r=e(67576),l=e(1087),n=e(63130),h=e(18350),d=(e(93444),e(72554)),c=e(81619),p=t([h,d]);[h,d]=p.then?(await p)():p;let u,b,y,m,_,f,g=t=>t;class v extends i.WF{async showDialog(t){this._params=t,this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}showDataAsHex(t){var a;return(null!==(a=t.match(/.{2}/g))&&void 0!==a?a:[]).map(t=>`0x${t.toUpperCase()}`).join(" ")}async _copyToClipboard(){this._params&&(await(0,n.l)(JSON.stringify(this._params.entry)),(0,c.P)(this,{message:this.hass.localize("ui.common.copied_clipboard")}))}render(){return this._params?(0,i.qy)(u||(u=g` <ha-dialog .open="${0}" header-title="${0}" @closed="${0}"> <p> <b>${0}</b>: ${0} <br> <b>${0}</b>: ${0} <br> <b>${0}</b>: ${0} </p> <h3> ${0} </h3> <h4> ${0} </h4> <table width="100%"> <tbody> ${0} </tbody> </table> <h4>${0}</h4> <table width="100%"> <tbody> ${0} </tbody> </table> <h4> ${0} </h4> <table width="100%"> <tbody> ${0} </tbody> </table> ${0} <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" @click="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this._open,this.hass.localize("ui.panel.config.bluetooth.device_information"),this._dialogClosed,this.hass.localize("ui.panel.config.bluetooth.address"),this._params.entry.address,this.hass.localize("ui.panel.config.bluetooth.name"),this._params.entry.name,this.hass.localize("ui.panel.config.bluetooth.source"),this._params.entry.source,this.hass.localize("ui.panel.config.bluetooth.advertisement_data"),this.hass.localize("ui.panel.config.bluetooth.manufacturer_data"),Object.entries(this._params.entry.manufacturer_data).map(([t,a])=>(0,i.qy)(b||(b=g` <tr> <td><b>${0}</b></td> <td>${0}</td> </tr> `),t,this.showDataAsHex(a))),this.hass.localize("ui.panel.config.bluetooth.service_data"),Object.entries(this._params.entry.service_data).map(([t,a])=>(0,i.qy)(y||(y=g` <tr> <td><b>${0}</b></td> <td>${0}</td> </tr> `),t,this.showDataAsHex(a))),this.hass.localize("ui.panel.config.bluetooth.service_uuids"),this._params.entry.service_uuids.map(t=>(0,i.qy)(m||(m=g` <tr> <td>${0}</td> </tr> `),t)),this._params.entry.raw?(0,i.qy)(_||(_=g` <h4> ${0} </h4> <div class="raw"> ${0} </div> `),this.hass.localize("ui.panel.config.bluetooth.raw_advertisement"),this.showDataAsHex(this._params.entry.raw)):i.s6,this._copyToClipboard,this.hass.localize("ui.panel.config.bluetooth.copy_to_clipboard")):i.s6}constructor(...t){super(...t),this._open=!1}}v.styles=(0,i.AH)(f||(f=g`.raw{word-break:break-all;font-family:var(--ha-font-family-code);font-size:var(--ha-font-size-s)}`)),(0,s.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,s.Cg)([(0,r.wk)()],v.prototype,"_params",void 0),(0,s.Cg)([(0,r.wk)()],v.prototype,"_open",void 0),v=(0,s.Cg)([(0,r.EM)("dialog-bluetooth-device-info")],v),o()}catch(u){o(u)}})}}]);