From 701cdda38c23853c2bc9c9b0babaae9acee0d08b Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 4 Apr 2024 21:33:39 +0200 Subject: [PATCH] Update zigbee-herdsman-converters to 19.14.0 (#22065) * fix(ignore): update zigbee-herdsman-converters to 19.14.0 * fix tests --------- Co-authored-by: Koenkk <2892853+Koenkk@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- test/bind.test.js | 2 +- test/configure.test.js | 2 +- test/otaUpdate.test.js | 18 +++++++++--------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 54e9c6843..0d1fa4c23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "winston-transport": "^4.7.0", "ws": "^8.16.0", "zigbee-herdsman": "0.41.1", - "zigbee-herdsman-converters": "19.13.0", + "zigbee-herdsman-converters": "19.14.0", "zigbee2mqtt-frontend": "0.6.161" }, "bin": { @@ -9802,9 +9802,9 @@ } }, "node_modules/zigbee-herdsman-converters": { - "version": "19.13.0", - "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-19.13.0.tgz", - "integrity": "sha512-UeeanNDLwTPBMC4U7doARcRA7vIMpBhNqEPHqIjpRItJh+bSyy2br17+yA4Eq3ZrvGr13gzXBI5ImdNYWJju2g==", + "version": "19.14.0", + "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-19.14.0.tgz", + "integrity": "sha512-xoDZdKF0n30FnIs7fyKuDFst7xjlcWGQlGnOwIpcUCCrhyYHlQ1sJpjGiocRtm1n7ue1l5N7RXhYZBj03AfKgw==", "dependencies": { "axios": "^1.6.8", "buffer-crc32": "^1.0.0", diff --git a/package.json b/package.json index 82dcf883b..b63805eb0 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "winston-transport": "^4.7.0", "ws": "^8.16.0", "zigbee-herdsman": "0.41.1", - "zigbee-herdsman-converters": "19.13.0", + "zigbee-herdsman-converters": "19.14.0", "zigbee2mqtt-frontend": "0.6.161" }, "devDependencies": { diff --git a/test/bind.test.js b/test/bind.test.js index 5e39bbe5c..ad82741df 100644 --- a/test/bind.test.js +++ b/test/bind.test.js @@ -157,7 +157,7 @@ describe('Bind', () => { expect(target.configureReporting).toHaveBeenCalledWith("genOnOff",[{"attribute": "onOff", "maximumReportInterval": 0xFFFF, "minimumReportInterval": 0, "reportableChange": 0}]); expect(target.configureReporting).toHaveBeenCalledWith("genLevelCtrl",[{"attribute": "currentLevel", "maximumReportInterval": 0xFFFF, "minimumReportInterval": 5, "reportableChange": 1}]); expect(target.configureReporting).toHaveBeenCalledWith("lightingColorCtrl",[{"attribute":"colorTemperature","minimumReportInterval":5,"maximumReportInterval":0xFFFF,"reportableChange":1},{"attribute":"currentX","minimumReportInterval":5,"maximumReportInterval":0xFFFF,"reportableChange":1},{"attribute":"currentY","minimumReportInterval":5,"maximumReportInterval":0xFFFF,"reportableChange":1}]); - expect(zigbeeHerdsman.devices.bulb_color.meta.configured).toBe(1324213189); + expect(zigbeeHerdsman.devices.bulb_color.meta.configured).toBe(1889700129); expect(MQTT.publish).toHaveBeenCalledWith( 'zigbee2mqtt/bridge/response/device/unbind', stringify({"data":{"from":"remote","to":"bulb_color","clusters":["genScenes","genOnOff","genLevelCtrl"],"failed":[]},"status":"ok"}), diff --git a/test/configure.test.js b/test/configure.test.js index 8f7a6265f..ed896e2bc 100644 --- a/test/configure.test.js +++ b/test/configure.test.js @@ -24,7 +24,7 @@ describe('Configure', () => { const endpoint2 = device.getEndpoint(2); expect(endpoint2.write).toHaveBeenCalledTimes(1); expect(endpoint2.write).toHaveBeenCalledWith("genBasic", {"49": {"type": 25, "value": 11}}, {"disableDefaultResponse": true, "manufacturerCode": 4107}); - expect(device.meta.configured).toBe(1324213189); + expect(device.meta.configured).toBe(1889700129); } const expectBulbConfigured = () => { diff --git a/test/otaUpdate.test.js b/test/otaUpdate.test.js index 6b38a3a95..093d1e139 100644 --- a/test/otaUpdate.test.js +++ b/test/otaUpdate.test.js @@ -72,7 +72,7 @@ describe('OTA update', () => { mockClear(mapped); logger.info.mockClear(); device.save.mockClear(); - mapped.ota.updateToLatest.mockImplementationOnce((a, b, onUpdate) => { + mapped.ota.updateToLatest.mockImplementationOnce((a, onUpdate) => { onUpdate(0, null); onUpdate(10, 3600.2123); return 90; @@ -83,7 +83,7 @@ describe('OTA update', () => { expect(logger.info).toHaveBeenCalledWith(`Updating 'bulb' to latest firmware`); expect(mapped.ota.isUpdateAvailable).toHaveBeenCalledTimes(0); expect(mapped.ota.updateToLatest).toHaveBeenCalledTimes(1); - expect(mapped.ota.updateToLatest).toHaveBeenCalledWith(device, logger, expect.any(Function)); + expect(mapped.ota.updateToLatest).toHaveBeenCalledWith(device, 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(`Finished update of 'bulb'`); @@ -126,7 +126,7 @@ describe('OTA update', () => { const mapped = await zigbeeHerdsmanConverters.findByDevice(device) mockClear(mapped); device.save.mockClear(); - mapped.ota.updateToLatest.mockImplementationOnce((a, b, onUpdate) => { + mapped.ota.updateToLatest.mockImplementationOnce((a, onUpdate) => { throw new Error('Update failed'); }); @@ -260,7 +260,7 @@ describe('OTA update', () => { await zigbeeHerdsman.events.message(payload); await flushPromises(); expect(mapped.ota.isUpdateAvailable).toHaveBeenCalledTimes(1); - expect(mapped.ota.isUpdateAvailable).toHaveBeenCalledWith(device, logger, {"imageType": 12382}); + expect(mapped.ota.isUpdateAvailable).toHaveBeenCalledWith(device, {"imageType": 12382}); expect(logger.info).toHaveBeenCalledWith(`Update available for 'bulb'`); expect(device.endpoints[0].commandResponse).toHaveBeenCalledTimes(1); expect(device.endpoints[0].commandResponse).toHaveBeenCalledWith("genOta", "queryNextImageResponse", {"status": 0x98}, undefined, 10); @@ -294,7 +294,7 @@ describe('OTA update', () => { await zigbeeHerdsman.events.message(payload); await flushPromises(); expect(mapped.ota.isUpdateAvailable).toHaveBeenCalledTimes(1); - expect(mapped.ota.isUpdateAvailable).toHaveBeenCalledWith(device, logger, {"imageType": 12382}); + expect(mapped.ota.isUpdateAvailable).toHaveBeenCalledWith(device, {"imageType": 12382}); expect(device.endpoints[0].commandResponse).toHaveBeenCalledTimes(1); expect(device.endpoints[0].commandResponse).toHaveBeenCalledWith("genOta", "queryNextImageResponse", {"status": 0x98}, undefined, 10); expect(MQTT.publish).toHaveBeenCalledWith( @@ -316,7 +316,7 @@ describe('OTA update', () => { await zigbeeHerdsman.events.message(payload); await flushPromises(); expect(mapped.ota.isUpdateAvailable).toHaveBeenCalledTimes(1); - expect(mapped.ota.isUpdateAvailable).toHaveBeenCalledWith(device, logger, {"imageType": 12382}); + expect(mapped.ota.isUpdateAvailable).toHaveBeenCalledWith(device, {"imageType": 12382}); expect(device.endpoints[0].commandResponse).toHaveBeenCalledTimes(1); expect(device.endpoints[0].commandResponse).toHaveBeenCalledWith("genOta", "queryNextImageResponse", {"status": 0x98}, undefined, 10); expect(MQTT.publish).toHaveBeenCalledWith( @@ -374,7 +374,7 @@ describe('OTA update', () => { logger.info.mockClear(); logger.error.mockClear(); device.save.mockClear(); - mapped.ota.updateToLatest.mockImplementationOnce((a, b, onUpdate) => { + mapped.ota.updateToLatest.mockImplementationOnce((a, onUpdate) => { onUpdate(0, null); onUpdate(10, 3600); return 91; @@ -385,7 +385,7 @@ describe('OTA update', () => { expect(logger.info).toHaveBeenCalledWith(`Updating 'bulb' to latest firmware`); expect(mapped.ota.isUpdateAvailable).toHaveBeenCalledTimes(0); expect(mapped.ota.updateToLatest).toHaveBeenCalledTimes(1); - expect(mapped.ota.updateToLatest).toHaveBeenCalledWith(device, logger, expect.any(Function)); + expect(mapped.ota.updateToLatest).toHaveBeenCalledWith(device, 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(`Finished update of 'bulb'`); @@ -404,7 +404,7 @@ describe('OTA update', () => { logger.info.mockClear(); logger.error.mockClear(); device.save.mockClear(); - mapped.ota.updateToLatest.mockImplementationOnce((a, b, onUpdate) => { + mapped.ota.updateToLatest.mockImplementationOnce((a, onUpdate) => { throw new Error('Update failed'); });