diff --git a/lib/extension/otaUpdate.js b/lib/extension/otaUpdate.js index ae3ccd9e6..6809590a5 100644 --- a/lib/extension/otaUpdate.js +++ b/lib/extension/otaUpdate.js @@ -170,7 +170,7 @@ class OTAUpdate extends Extension { try { const onProgress = (progress, remaining) => { - let message = `Update of '${resolvedEntity.name}' at ${progress}%`; + let message = `Update of '${resolvedEntity.name}' at ${progress.toFixed(2)}%`; if (remaining) { message += `, +- ${Math.round(remaining / 60)} minutes remaining`; } diff --git a/test/otaUpdate.test.js b/test/otaUpdate.test.js index 60c7a32f9..8a78aaa3a 100644 --- a/test/otaUpdate.test.js +++ b/test/otaUpdate.test.js @@ -54,8 +54,8 @@ describe('OTA update', () => { expect(mapped.ota.isUpdateAvailable).toHaveBeenCalledTimes(0); expect(mapped.ota.updateToLatest).toHaveBeenCalledTimes(1); expect(mapped.ota.updateToLatest).toHaveBeenCalledWith(device, logger, expect.any(Function)); - expect(logger.info).toHaveBeenCalledWith(`Update of 'bulb' at 0%`); - expect(logger.info).toHaveBeenCalledWith(`Update of 'bulb' at 10%, +- 60 minutes remaining`); + expect(logger.info).toHaveBeenCalledWith(`Update of 'bulb' at 0.00%`); + expect(logger.info).toHaveBeenCalledWith(`Update of 'bulb' at 10.00%, +- 60 minutes remaining`); expect(logger.info).toHaveBeenCalledWith(`Finished update of 'bulb', from '{"softwareBuildID":1,"dateCode":"20190101"}' to '{"softwareBuildID":2,"dateCode":"20190102"}'`); expect(logger.error).toHaveBeenCalledTimes(0); expect(device.save).toHaveBeenCalledTimes(1);