UNPKG

zwave-js-ui

Version:

Z-Wave Control Panel and MQTT Gateway

9 lines (5 loc) 1.69 kB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FirmwareUpdates-ChucsiRT.js","./index-B9yS4Bcc.js","./index-Bm7DxUwf.css"])))=>i.map(i=>d[i]); import{_ as n,d,z as s,I as i,r as p,o as c,l as w}from"./index-B9yS4Bcc.js";const m={components:{FirmwareUpdates:d(()=>s(()=>import("./FirmwareUpdates-ChucsiRT.js"),__vite__mapDeps([0,1,2]),import.meta.url))},mixins:[i],props:{node:{type:Object,required:!0},socket:{type:Object,required:!0}},data(){return{}},methods:{async updateFirmware(e){if(await this.app.confirm(`OTA ${e.downgrade?"Downgrade":"Upgrade"}`,`<p>Are you sure you want to ${e.downgrade?"downgrade":"upgrade"} node to <b>v${e.version}</b>?</p> <p><strong>We don't take any responsibility if devices upgraded using Z-Wave JS don't work after an update. Always double-check that the correct update is about to be installed</strong></p> <p>This will download the desired firmware update from the <a href="https://github.com/zwave-js/firmware-updates/">Z-Wave JS firmware update service</a> and start an over-the-air (OTA) firmware update for the given node.</p> `,e.downgrade?"error":"warning",{confirmText:`${e.downgrade?"Downgrade":"Upgrade"}`,cancelText:"Cancel",width:"500px"})){const a=await this.app.apiRequest("firmwareUpdateOTA",[this.node.id,e]);await this.app.handleFwUpdateResponse(a)}}}};function u(e,a,t,f,l,r){const o=p("FirmwareUpdates");return c(),w(o,{node:t.node,socket:t.socket,"update-type":"OTA",onUpdateFirmware:r.updateFirmware},null,8,["node","socket","onUpdateFirmware"])}const _=n(m,[["render",u]]);export{_ as default};