diff --git a/package-lock.json b/package-lock.json index 00b4af7..41bdc1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "arduino-create-agent-js-client", - "version": "2.4.7", + "version": "2.4.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c5f3f9f..fbd32ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "arduino-create-agent-js-client", - "version": "2.4.7", + "version": "2.4.8", "description": "JS module providing discovery of the Arduino Create Plugin and communication with it", "main": "lib/index.js", "module": "es/index.js", diff --git a/src/firmware-updater.js b/src/firmware-updater.js index 9b16442..299e643 100644 --- a/src/firmware-updater.js +++ b/src/firmware-updater.js @@ -163,14 +163,16 @@ export default class FirmwareUpdater { const handleFirmwareUpdateMessage = message => { switch (message.ProgrammerStatus) { + case 'Busy': + if (message.Msg.indexOf('Operation completed: success! :-)') >= 0) { + this.updating.next({ status: this.updateStatusEnum.DONE }); + updateFirmwareMessagesSubscription.unsubscribe(); + } + break; case 'Error': this.updating.next({ status: this.updateStatusEnum.ERROR, err: `Can't update Firmware: ${message.Msg}` }); updateFirmwareMessagesSubscription.unsubscribe(); break; - case 'Done': - this.updating.next({ status: this.updateStatusEnum.DONE }); - updateFirmwareMessagesSubscription.unsubscribe(); - break; default: break; }