From ad0bbbec97a5ccef1db24539c23ae0e55dcf886d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2020 18:58:17 +0200 Subject: [PATCH] Update zigbee-herdsman-converters to 12.0.146 * Update zigbee-herdsman-converters to 12.0.146 * Update publish.test.js * Update homeassistant.js Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Koen Kanters --- lib/extension/homeassistant.js | 1 + npm-shrinkwrap.json | 6 +++--- package.json | 2 +- test/publish.test.js | 23 +++++++++++++++++++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/lib/extension/homeassistant.js b/lib/extension/homeassistant.js index b034560c..6b58688e 100644 --- a/lib/extension/homeassistant.js +++ b/lib/extension/homeassistant.js @@ -1783,6 +1783,7 @@ const mapping = { 'X712A': [switchEndpoint('l1'), switchEndpoint('l2')], 'TYZS1L': [cfg.light_brightness_colortemp_colorxy], '43102': [cfg.switch], + '1746430P7': [cfg.light_brightness_colortemp_colorxy], }; const defaultStatusTopic = 'homeassistant/status'; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 6dbc3b8b..da21d823 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -14711,9 +14711,9 @@ } }, "zigbee-herdsman-converters": { - "version": "12.0.141", - "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-12.0.141.tgz", - "integrity": "sha512-GmhicEGWuYCSTwMMG4ENewnX+kQVwqFpxvkdb/RK6jHPukgBzmUxIzldgYLas+LSxyOWr7E4j3tLeBgxI/KLqg==", + "version": "12.0.146", + "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-12.0.146.tgz", + "integrity": "sha512-cYdSs0YK/ABkLWt2pdv8sAdt753GWBArnqkqIrGmWjEXcBrfZDO/6Y/SzuaczmWSjFTN/THNTmYmBpSE1gbOtA==", "requires": { "axios": "^0.19.2", "https-proxy-agent": "^5.0.0", diff --git a/package.json b/package.json index 7e8f0b89..188ac1ee 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "winston": "^3.3.3", "winston-syslog": "^2.4.4", "zigbee-herdsman": "0.12.108", - "zigbee-herdsman-converters": "12.0.141" + "zigbee-herdsman-converters": "12.0.146" }, "devDependencies": { "eslint": "*", diff --git a/test/publish.test.js b/test/publish.test.js index a610d020..25af1f52 100644 --- a/test/publish.test.js +++ b/test/publish.test.js @@ -640,6 +640,29 @@ describe('Publish', () => { expect(endpoint.command.mock.calls[0]).toEqual(["genLevelCtrl", "moveToLevelWithOnOff", {level: 20, transtime: 200}, {}]); }); + it('Should turn bulb on with full brightness when transition is used and no brightness is known', async () => { + // https://github.com/Koenkk/zigbee2mqtt/issues/3799 + const device = zigbeeHerdsman.devices.bulb_color; + const endpoint = device.getEndpoint(1); + await MQTT.events.message('zigbee2mqtt/bulb_color/set', JSON.stringify({"state": "OFF", "transition": 0.5})); + await flushPromises(); + await MQTT.events.message('zigbee2mqtt/bulb_color/set', JSON.stringify({"state": "ON", "transition": 0.5})); + await flushPromises(); + expect(MQTT.publish).toHaveBeenNthCalledWith(1, + 'zigbee2mqtt/bulb_color', + JSON.stringify({state: 'OFF', brightness: 0}), + {retain: false, qos: 0}, expect.any(Function) + ); + expect(MQTT.publish).toHaveBeenNthCalledWith(2, + 'zigbee2mqtt/bulb_color', + JSON.stringify({state: 'ON', brightness: 254}), + {retain: false, qos: 0}, expect.any(Function) + ); + expect(endpoint.command).toHaveBeenCalledTimes(2); + expect(endpoint.command.mock.calls[0]).toEqual(["genLevelCtrl", "moveToLevelWithOnOff", {level: 0, transtime: 5}, {}]); + expect(endpoint.command.mock.calls[1]).toEqual(["genLevelCtrl", "moveToLevelWithOnOff", {level: 254, transtime: 5}, {}]); + }); + it('Transition parameter should not influence brightness on state ON', async () => { // https://github.com/Koenkk/zigbee2mqtt/issues/3563 const device = zigbeeHerdsman.devices.bulb_color;