From 049deaf590962f7cf16ff877ea365490b89dcbd4 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 21 Feb 2021 20:47:00 +0100 Subject: [PATCH] =?UTF-8?q?Change=20+-=20to=20=E2=89=88=20for=20OTA=20upda?= =?UTF-8?q?te=20message.=20https://github.com/Koenkk/zigbee2mqtt/issues/63?= =?UTF-8?q?97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/extension/otaUpdate.js | 2 +- test/otaUpdate.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/extension/otaUpdate.js b/lib/extension/otaUpdate.js index 82baaa50..8976f4ca 100644 --- a/lib/extension/otaUpdate.js +++ b/lib/extension/otaUpdate.js @@ -200,7 +200,7 @@ class OTAUpdate extends Extension { const onProgress = (progress, remaining) => { let msg = `Update of '${resolvedEntity.name}' at ${progress.toFixed(2)}%`; if (remaining) { - msg += `, +- ${Math.round(remaining / 60)} minutes remaining`; + msg += `, ≈ ${Math.round(remaining / 60)} minutes remaining`; } logger.info(msg); diff --git a/test/otaUpdate.test.js b/test/otaUpdate.test.js index dcda99f2..8e9fc459 100644 --- a/test/otaUpdate.test.js +++ b/test/otaUpdate.test.js @@ -51,7 +51,7 @@ describe('OTA update', () => { 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.00%`); - expect(logger.info).toHaveBeenCalledWith(`Update of 'bulb' at 10.00%, +- 60 minutes remaining`); + expect(logger.info).toHaveBeenCalledWith(`Update of 'bulb' at 10.00%, ≈ 60 minutes remaining`); expect(logger.info).toHaveBeenCalledWith(`Finished update of 'bulb', from '{"dateCode":"20190101","softwareBuildID":1}' to '{"dateCode":"20190102","softwareBuildID":2}'`); expect(device.save).toHaveBeenCalledTimes(1); expect(device.dateCode).toBe('20190102'); @@ -310,7 +310,7 @@ describe('OTA update', () => { 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.00%`); - expect(logger.info).toHaveBeenCalledWith(`Update of 'bulb' at 10.00%, +- 60 minutes remaining`); + expect(logger.info).toHaveBeenCalledWith(`Update of 'bulb' at 10.00%, ≈ 60 minutes remaining`); expect(logger.info).toHaveBeenCalledWith(`Finished update of 'bulb', from '{"dateCode":"20190101","softwareBuildID":1}' to '{"dateCode":"20190102","softwareBuildID":2}'`); expect(logger.error).toHaveBeenCalledTimes(0); expect(device.save).toHaveBeenCalledTimes(1);