Skip to content

Commit 510b5de

Browse files
author
Alberto Iannaccone
authored
Change fw updater success condition (#493)
* change fw updater success condition * 2.4.8
1 parent 2f0e02f commit 510b5de

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "arduino-create-agent-js-client",
3-
"version": "2.4.7",
3+
"version": "2.4.8",
44
"description": "JS module providing discovery of the Arduino Create Plugin and communication with it",
55
"main": "lib/index.js",
66
"module": "es/index.js",

src/firmware-updater.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,16 @@ export default class FirmwareUpdater {
163163

164164
const handleFirmwareUpdateMessage = message => {
165165
switch (message.ProgrammerStatus) {
166+
case 'Busy':
167+
if (message.Msg.indexOf('Operation completed: success! :-)') >= 0) {
168+
this.updating.next({ status: this.updateStatusEnum.DONE });
169+
updateFirmwareMessagesSubscription.unsubscribe();
170+
}
171+
break;
166172
case 'Error':
167173
this.updating.next({ status: this.updateStatusEnum.ERROR, err: `Can't update Firmware: ${message.Msg}` });
168174
updateFirmwareMessagesSubscription.unsubscribe();
169175
break;
170-
case 'Done':
171-
this.updating.next({ status: this.updateStatusEnum.DONE });
172-
updateFirmwareMessagesSubscription.unsubscribe();
173-
break;
174176
default:
175177
break;
176178
}

0 commit comments

Comments
 (0)