From 93e96a2e5ecc11f9c4a18aee0b37f23eaa2edb4d Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 23 Jan 2020 21:00:50 +0100 Subject: [PATCH] Update converters. --- npm-shrinkwrap.json | 18 +++++++++--------- package.json | 4 ++-- test/entityPublish.test.js | 6 +++++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 16f7ea5f0..89890a3c7 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1561,9 +1561,9 @@ "dev": true }, "cssstyle": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.1.0.tgz", - "integrity": "sha512-1iwCdymVYhMdQWiZ+9mB7x+urdNLPGTWsIZt6euFk8Yi+dOERK2ccoAUA3Bl8I5vmK5qfz/eLkBRyLbs42ov4A==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.2.0.tgz", + "integrity": "sha512-sEb3XFPx3jNnCAMtqrXPDeSgQr+jojtCeNf8cvMNMh1cG970+lljssvQDzPq6lmmJu2Vhqood/gtEomBiHOGnA==", "dev": true, "requires": { "cssom": "~0.3.6" @@ -6798,9 +6798,9 @@ } }, "zigbee-herdsman": { - "version": "0.12.37", - "resolved": "https://registry.npmjs.org/zigbee-herdsman/-/zigbee-herdsman-0.12.37.tgz", - "integrity": "sha512-IwJ4OSsmdy950v1AbW2hmvAZ30j3NuzMasWIYjgVnXc0vdq/G3xlOj6PDwOhUxfKlSrEBcFlGpBpyPdi1B5m6g==", + "version": "0.12.39", + "resolved": "https://registry.npmjs.org/zigbee-herdsman/-/zigbee-herdsman-0.12.39.tgz", + "integrity": "sha512-3NvK+sfSEKjQzr1wK1qrhnhpj/RpnbIIwU/QyeCrMT/Sqmqzam9yIAOLnWeaSVp9Nc7AnMFM2T9D3am4pvGk1w==", "requires": { "debug": "^4.1.1", "fast-deep-equal": "^2.0.1", @@ -13445,9 +13445,9 @@ } }, "zigbee-herdsman-converters": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-12.0.4.tgz", - "integrity": "sha512-fNQlsbqSQSymSlWuxn9snmmxpp1A/7dIalJ6EDBs7XuM0QcdDxwJx7T0XJJNwgtb4PtOBy2pTzP487ZiGiws8A==", + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-12.0.5.tgz", + "integrity": "sha512-lpVpn9/rrw1G2csRB5dSo5GatJI/DBrcACA+BDz+pTAI2ega57K7YIw1+NkWbV2bQtNZTQhhT289xYLDC5C5GA==", "dependencies": { "@babel/code-frame": { "version": "7.5.5", diff --git a/package.json b/package.json index 193a1fbaa..b713e4e6e 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,8 @@ "rimraf": "*", "semver": "*", "winston": "*", - "zigbee-herdsman": "0.12.37", - "zigbee-herdsman-converters": "12.0.4" + "zigbee-herdsman": "0.12.39", + "zigbee-herdsman-converters": "12.0.5" }, "devDependencies": { "eslint": "*", diff --git a/test/entityPublish.test.js b/test/entityPublish.test.js index eec386e51..28763fdd3 100644 --- a/test/entityPublish.test.js +++ b/test/entityPublish.test.js @@ -934,14 +934,18 @@ describe('Entity publish', () => { it('Should publish separate genOnOff to GL-S-007ZS when setting state and brightness as bulb doesnt turn on with moveToLevelWithOnOff', async () => { // https://github.com/Koenkk/zigbee2mqtt/issues/2757 + jest.useFakeTimers(); const device = zigbeeHerdsman.devices['GL-S-007ZS']; const endpoint = device.getEndpoint(1); await MQTT.events.message('zigbee2mqtt/GL-S-007ZS/set', JSON.stringify({state: 'ON', brightness: 20})); await flushPromises(); + jest.runAllTimers(); + await flushPromises(); expect(endpoint.command).toHaveBeenCalledTimes(2); expect(endpoint.command.mock.calls[0]).toEqual([ 'genOnOff', 'on', {}, {} ]); expect(endpoint.command.mock.calls[1]).toEqual([ 'genLevelCtrl', 'moveToLevelWithOnOff', { level: 20, transtime: 0 }, {} ]); expect(MQTT.publish).toHaveBeenCalledTimes(1); - expect(MQTT.publish.mock.calls[0]).toEqual([ 'zigbee2mqtt/GL-S-007ZS', '{"state":"ON","brightness":20}', { qos: 0, retain: false }, expect.any(Function)]) + expect(MQTT.publish.mock.calls[0]).toEqual([ 'zigbee2mqtt/GL-S-007ZS', '{"state":"ON","brightness":20}', { qos: 0, retain: false }, expect.any(Function)]); + jest.useRealTimers(); }); });