diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 86f48a602..69f47abad 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -13207,9 +13207,9 @@ } }, "zigbee-herdsman-converters": { - "version": "14.0.366", - "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-14.0.366.tgz", - "integrity": "sha512-GGxWDhU1aBYwWJaM9SkX9nVVTORc5wumy9D9Z5TDJBSKkVrobAFYBDXB9GTvk+ZMrqVXgIdKgwalgoJjQg5qag==", + "version": "14.0.367", + "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-14.0.367.tgz", + "integrity": "sha512-9F23p7HiHywi5GHu/Sc3YiBys82qdLl3t85xh7n7V7BsJ+ShBR4UyjslBTeIwkudKzLtPzALwrDXe0uhWyhmGA==", "requires": { "axios": "^0.24.0", "buffer-crc32": "^0.2.13", @@ -13984,9 +13984,9 @@ "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==" }, "@types/node": { - "version": "17.0.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.5.tgz", - "integrity": "sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw==" + "version": "17.0.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.6.tgz", + "integrity": "sha512-+XBAjfZmmivILUzO0HwBJoYkAyyySSLg5KCGBDFLomJo0sV6szvVLAf4ANZZ0pfWzgEds5KmGLG9D5hfEqOhaA==" }, "@types/prettier": { "version": "2.4.2", @@ -14374,9 +14374,9 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "caniuse-lite": { - "version": "1.0.30001294", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001294.tgz", - "integrity": "sha512-LiMlrs1nSKZ8qkNhpUf5KD0Al1KCBE3zaT7OLOwEkagXMEDij98SiOovn9wxVGQpklk9vVC/pUSqgYmkmKOS8g==" + "version": "1.0.30001295", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001295.tgz", + "integrity": "sha512-lSP16vcyC0FEy0R4ECc9duSPoKoZy+YkpGkue9G4D81OfPnliopaZrU10+qtPdT8PbGXad/PNx43TIQrOmJZSQ==" }, "chalk": { "version": "4.1.2", @@ -14718,9 +14718,9 @@ "integrity": "sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw==" }, "eslint-plugin-jest": { - "version": "25.3.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-25.3.3.tgz", - "integrity": "sha512-qi7aduaU4/oWegWo0zH4kbJbx8+Be+ABTr72OnO68zTMcJeeSuyH1CduTGF4ATyNFgpE1zp0u10/gIhe+QDSfg==", + "version": "25.3.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-25.3.4.tgz", + "integrity": "sha512-CCnwG71wvabmwq/qkz0HWIqBHQxw6pXB1uqt24dxqJ9WB34pVg49bL1sjXphlJHgTMWGhBjN1PicdyxDxrfP5A==", "requires": { "@typescript-eslint/experimental-utils": "^5.0.0" } @@ -15671,9 +15671,9 @@ }, "dependencies": { "camelcase": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", - "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==" + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==" } } }, diff --git a/package.json b/package.json index 98214afe2..e378e7d9b 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "winston-syslog": "^2.4.4", "ws": "^8.4.0", "zigbee-herdsman": "0.13.189", - "zigbee-herdsman-converters": "14.0.366", + "zigbee-herdsman-converters": "14.0.367", "zigbee2mqtt-frontend": "0.6.67" }, "devDependencies": { diff --git a/test/publish.test.js b/test/publish.test.js index 4b37d52dd..c8dd2e58a 100644 --- a/test/publish.test.js +++ b/test/publish.test.js @@ -367,7 +367,7 @@ describe('Publish', () => { await MQTT.events.message('zigbee2mqtt/thermostat_group/set', stringify({child_lock: 'LOCK'})); await flushPromises(); expect(group.command).toHaveBeenCalledTimes(1); - expect(group.command).toHaveBeenCalledWith("manuSpecificTuya", "dataRequest", {data: [1], datatype: 1, dp: 7, length_hi: 0, length_lo: 1, seq: expect.any(Number)}, {disableDefaultResponse: true}); + expect(group.command).toHaveBeenCalledWith("manuSpecificTuya", "dataRequest", {dpValues: [{data: [1], datatype: 1, dp: 7}], seq: expect.any(Number)}, {disableDefaultResponse: true}); }); it('Should publish messages to groups with on and brightness', async () => { @@ -907,33 +907,6 @@ describe('Publish', () => { expect(endpoint.command.mock.calls[1]).toEqual(["lightingColorCtrl", "moveToColor", {"colorx": 45940, "colory": 19595, "transtime": 30}, {}]); }); - it('Should correctly toggle when transition is used', async () => { - settings.set(['devices', zigbeeHerdsman.devices.bulb_color.ieeeAddr, 'transition'], 20); - const endpoint = zigbeeHerdsman.devices.bulb_color.getEndpoint(1); - await MQTT.events.message('zigbee2mqtt/bulb_color/set', stringify({state: 'ON', brightness: 163})); - await flushPromises(); - await MQTT.events.message('zigbee2mqtt/bulb_color/set', stringify({state: 'OFF'})); - await flushPromises(); - await MQTT.events.message('zigbee2mqtt/bulb_color/set', stringify({state: 'TOGGLE',})); - await flushPromises(); - await MQTT.events.message('zigbee2mqtt/bulb_color/set', stringify({state: 'TOGGLE',})); - await flushPromises(); - expect(endpoint.command).toHaveBeenCalledTimes(4); - expect(endpoint.command).toHaveBeenNthCalledWith(1, "genLevelCtrl", "moveToLevelWithOnOff", {"level": 163, "transtime": 200}, {}) - expect(endpoint.command).toHaveBeenNthCalledWith(2, "genLevelCtrl", "moveToLevelWithOnOff", {"level": 0, "transtime": 200}, {}) - expect(endpoint.command).toHaveBeenNthCalledWith(3, "genLevelCtrl", "moveToLevelWithOnOff", {"level": 163, "transtime": 200}, {}) - expect(endpoint.command).toHaveBeenNthCalledWith(4, "genLevelCtrl", "moveToLevelWithOnOff", {"level": 0, "transtime": 200}, {}) - expect(MQTT.publish).toHaveBeenCalledTimes(4); - expect(MQTT.publish).toHaveBeenNthCalledWith(1, 'zigbee2mqtt/bulb_color', stringify({"brightness":163,"state":"ON"}), - { retain: false, qos: 0 }, expect.any(Function)); - expect(MQTT.publish).toHaveBeenNthCalledWith(2, 'zigbee2mqtt/bulb_color', stringify({"brightness":163,"state":"OFF"}), - { retain: false, qos: 0 }, expect.any(Function)); - expect(MQTT.publish).toHaveBeenNthCalledWith(3, 'zigbee2mqtt/bulb_color', stringify({"brightness":163,"state":"ON"}), - { retain: false, qos: 0 }, expect.any(Function)); - expect(MQTT.publish).toHaveBeenNthCalledWith(4, 'zigbee2mqtt/bulb_color', stringify({"brightness":163,"state":"OFF"}), - { retain: false, qos: 0 }, expect.any(Function)); - }); - it('Should turn device off when brightness 0 is send', async () => { const device = zigbeeHerdsman.devices.bulb_color; const endpoint = device.getEndpoint(1); @@ -1321,7 +1294,7 @@ describe('Publish', () => { await MQTT.events.message('zigbee2mqtt/MKS-CM-W5/l3/set', stringify({state: 'ON'})); await flushPromises(); expect(endpoint.command).toHaveBeenCalledTimes(1); - expect(endpoint.command).toHaveBeenCalledWith("manuSpecificTuya", "dataRequest", {data: [1], datatype: 1, dp: 3, length_hi: 0, length_lo: 1, seq: expect.any(Number)}, {disableDefaultResponse: true}); + expect(endpoint.command).toHaveBeenCalledWith("manuSpecificTuya", "dataRequest", {dpValues: [{data: [1], datatype: 1, dp: 3}], seq: expect.any(Number)}, {disableDefaultResponse: true}); expect(MQTT.publish).toHaveBeenCalledTimes(1); expect(MQTT.publish.mock.calls[0][0]).toStrictEqual('zigbee2mqtt/MKS-CM-W5'); expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({state_l3: 'ON'});