iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 4.57 kB
JavaScript
export const __webpack_ids__=["2424"];export const __webpack_modules__={69804:function(i,e,s){s.a(i,(async function(i,t){try{s.r(e);var a=s(44249),n=(s(9359),s(70104),s(31622),s(57243)),o=s(15093),c=s(36522),d=s(17170),l=s(73729),r=s(79011),h=s(28008),v=i([d]);d=(v.then?(await v)():v)[0];const u="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",_="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";(0,a.Z)([(0,o.Mo)("dialog-zwave_js-reinterview-node")],(function(i,e){return{F:class extends e{constructor(...e){super(...e),i(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:"_status",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_stages",value:void 0},{kind:"field",key:"_subscribed",value:void 0},{kind:"method",key:"showDialog",value:async function(i){this._stages=void 0,this.device_id=i.device_id}},{kind:"method",key:"render",value:function(){return this.device_id?n.dy` <ha-dialog open ="${this.closeDialog}" .heading="${(0,l.i)(this.hass,this.hass.localize("ui.panel.config.zwave_js.reinterview_node.title"))}"> ${this._status?"":n.dy` <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> <mwc-button slot="primaryAction" ="${this._startReinterview}"> ${this.hass.localize("ui.panel.config.zwave_js.reinterview_node.start_reinterview")} </mwc-button> `} ${"started"===this._status?n.dy` <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> <mwc-button slot="primaryAction" ="${this.closeDialog}"> ${this.hass.localize("ui.common.close")} </mwc-button> `:""} ${"failed"===this._status?n.dy` <div class="flex-container"> <ha-svg-icon .path="${_}" class="failed"></ha-svg-icon> <div class="status"> <p> ${this.hass.localize("ui.panel.config.zwave_js.reinterview_node.interview_failed")} </p> </div> </div> <mwc-button slot="primaryAction" ="${this.closeDialog}"> ${this.hass.localize("ui.common.close")} </mwc-button> `:""} ${"finished"===this._status?n.dy` <div class="flex-container"> <ha-svg-icon .path="${u}" class="success"></ha-svg-icon> <div class="status"> <p> ${this.hass.localize("ui.panel.config.zwave_js.reinterview_node.interview_complete")} </p> </div> </div> <mwc-button slot="primaryAction" ="${this.closeDialog}"> ${this.hass.localize("ui.common.close")} </mwc-button> `:""} ${this._stages?n.dy` <div class="stages"> ${this._stages.map((i=>n.dy` <span class="stage"> <ha-svg-icon .path="${u}" class="success"></ha-svg-icon> ${i} </span> `))} </div> `:""} </ha-dialog> `:n.Ld}},{kind:"method",key:"_startReinterview",value:function(){this.hass&&(this._subscribed=(0,r.vN)(this.hass,this.device_id,this._handleMessage.bind(this)))}},{kind:"method",key:"_handleMessage",value:function(i){"interview started"===i.event&&(this._status="started"),"interview stage completed"===i.event&&(void 0===this._stages?this._stages=[i.stage]:this._stages=[...this._stages,i.stage]),"interview failed"===i.event&&(this._unsubscribe(),this._status="failed"),"interview completed"===i.event&&(this._unsubscribe(),this._status="finished")}},{kind:"method",key:"_unsubscribe",value:function(){this._subscribed&&(this._subscribed.then((i=>i())),this._subscribed=void 0)}},{kind:"method",key:"closeDialog",value:function(){this.device_id=void 0,this._status=void 0,this._stages=void 0,this._unsubscribe(),(0,c.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"get",static:!0,key:"styles",value:function(){return[h.yu,n.iv`.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}`]}}]}}),n.oi);t()}catch(i){t(i)}}))}};
//# sourceMappingURL=2424.6a4013d7e82542f2.js.map