UNPKG

iobroker.lovelace

Version:

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

1 lines 4.11 kB
export const __rspack_esm_id=34328;export const __rspack_esm_ids=[34328];export const __webpack_modules__={54283(s,i,e){e.a(s,async function(s,t){try{e.r(i);e(18111),e(61701);var a=e(62826),n=e(5124),o=e(22441),r=e(1087),c=e(65829),h=e(18350),l=(e(93444),e(72554)),d=e(72001),_=e(14503),v=s([c,h,l]);[c,h,l]=v.then?(await v)():v;const p="M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",g="M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z";class u extends n.WF{async showDialog(s){this._stages=void 0,this.device_id=s.device_id,this._open=!0}render(){return this.device_id?n.qy` <ha-dialog .open="${this._open}" header-title="${this.hass.localize("ui.panel.config.zwave_js.reinterview_node.title")}" @closed="${this._dialogClosed}"> ${this._status?"":n.qy` <p> ${this.hass.localize("ui.panel.config.zwave_js.reinterview_node.introduction")} </p> <p> <em> ${this.hass.localize("ui.panel.config.zwave_js.reinterview_node.battery_device_warning")} </em> </p> `} ${"started"===this._status?n.qy` <div class="flex-container"> <ha-spinner></ha-spinner> <div class="status"> <p> <b> ${this.hass.localize("ui.panel.config.zwave_js.reinterview_node.in_progress")} </b> </p> <p> ${this.hass.localize("ui.panel.config.zwave_js.reinterview_node.run_in_background")} </p> </div> </div> `:""} ${"failed"===this._status?n.qy` <div class="flex-container"> <ha-svg-icon .path="${g}" class="failed"></ha-svg-icon> <div class="status"> <p> ${this.hass.localize("ui.panel.config.zwave_js.reinterview_node.interview_failed")} </p> </div> </div> `:""} ${"finished"===this._status?n.qy` <div class="flex-container"> <ha-svg-icon .path="${p}" class="success"></ha-svg-icon> <div class="status"> <p> ${this.hass.localize("ui.panel.config.zwave_js.reinterview_node.interview_complete")} </p> </div> </div> `:""} ${this._stages?n.qy` <div class="stages"> ${this._stages.map(s=>n.qy` <span class="stage"> <ha-svg-icon .path="${p}" class="success"></ha-svg-icon> ${s} </span> `)} </div> `:""} <ha-dialog-footer slot="footer"> ${this._status?n.qy` <ha-button slot="primaryAction" @click="${this.closeDialog}"> ${this.hass.localize("ui.common.close")} </ha-button> `:n.qy` <ha-button slot="primaryAction" @click="${this._startReinterview}"> ${this.hass.localize("ui.panel.config.zwave_js.reinterview_node.start_reinterview")} </ha-button> `} </ha-dialog-footer> </ha-dialog> `:n.s6}_startReinterview(){this.hass&&(this._subscribed=(0,d.Eo)(this.hass,this.device_id,this._handleMessage.bind(this)))}_handleMessage(s){"interview started"===s.event&&(this._status="started"),"interview stage completed"===s.event&&(void 0===this._stages?this._stages=[s.stage]:this._stages=[...this._stages,s.stage]),"interview failed"===s.event&&(this._unsubscribe(),this._status="failed"),"interview completed"===s.event&&(this._unsubscribe(),this._status="finished")}_unsubscribe(){this._subscribed&&(this._subscribed.then(s=>s()),this._subscribed=void 0)}closeDialog(){this._open=!1}_dialogClosed(){this.device_id=void 0,this._status=void 0,this._stages=void 0,this._unsubscribe(),(0,r.r)(this,"dialog-closed",{dialog:this.localName})}static get styles(){return[_.nA,n.AH`.success{color:var(--success-color)}.failed{color:var(--error-color)}.flex-container{display:flex;align-items:center}.stages{margin-top:16px}.stage ha-svg-icon{width:16px;height:16px}.stage{padding:8px}ha-svg-icon{width:68px;height:48px}.flex-container ha-spinner,.flex-container ha-svg-icon{margin-right:20px;margin-inline-end:20px;margin-inline-start:initial}`]}constructor(...s){super(...s),this._open=!1}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,a.Cg)([(0,o.wk)()],u.prototype,"device_id",void 0),(0,a.Cg)([(0,o.wk)()],u.prototype,"_status",void 0),(0,a.Cg)([(0,o.wk)()],u.prototype,"_stages",void 0),(0,a.Cg)([(0,o.wk)()],u.prototype,"_open",void 0),u=(0,a.Cg)([(0,o.EM)("dialog-zwave_js-reinterview-node")],u),t()}catch(s){t(s)}})}};