From 02775910853c5c95bebc0edd110caa0a033502f9 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 22 Mar 2019 22:45:59 +0100 Subject: [PATCH] Update zigbee-shepherd-converters to 8.0.10. --- lib/extension/homeassistant.js | 2 ++ npm-shrinkwrap.json | 18 +++++++++--------- package.json | 2 +- test/devicePublish.test.js | 28 ++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/lib/extension/homeassistant.js b/lib/extension/homeassistant.js index a87e8800a..3747bab89 100644 --- a/lib/extension/homeassistant.js +++ b/lib/extension/homeassistant.js @@ -619,6 +619,8 @@ const mapping = { ], 'U86K31ND6': [switchWithPostfix('left'), switchWithPostfix('right'), switchWithPostfix('center')], 'HLD812-Z-SC': [configurations.light_brightness], + 'BY 285 C': [configurations.light_brightness_colortemp_colorxy], + 'HS1RC-M': [configurations.sensor_action, configurations.sensor_battery], }; Object.keys(mapping).forEach((key) => { diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7bfeefb7c..472286454 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -440,9 +440,9 @@ "dev": true }, "@types/node": { - "version": "11.11.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.4.tgz", - "integrity": "sha512-02tIL+QIi/RW4E5xILdoAMjeJ9kYq5t5S2vciUdFPXv/ikFTb0zK8q9vXkg4+WAJuYXGiVT1H28AkD2C+IkXVw==", + "version": "11.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", + "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==", "dev": true }, "@types/stack-utils": { @@ -5042,9 +5042,9 @@ } }, "react-is": { - "version": "16.8.4", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.4.tgz", - "integrity": "sha512-PVadd+WaUDOAciICm/J1waJaSvgq+4rHE/K70j0PFqKhkTBsPv/82UGQJNXAngz1fOQLLxI6z1sEDmJDQhCTAA==", + "version": "16.8.5", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.5.tgz", + "integrity": "sha512-sudt2uq5P/2TznPV4Wtdi+Lnq3yaYW8LfvPKLM9BKD8jJNBkxMVyB0C9/GmVhLw7Jbdmndk/73n7XQGeN9A3QQ==", "dev": true }, "read-pkg": { @@ -6447,9 +6447,9 @@ } }, "zigbee-shepherd-converters": { - "version": "8.0.9", - "resolved": "https://registry.npmjs.org/zigbee-shepherd-converters/-/zigbee-shepherd-converters-8.0.9.tgz", - "integrity": "sha512-JX8KqTKqtFuzZ6wHzHX36jBf5ky/skkY2g5SHI8ZAi60O22E1Q4locbbFe4zt5jnUyzfPp/PbJotfhvWk94RFg==", + "version": "8.0.10", + "resolved": "https://registry.npmjs.org/zigbee-shepherd-converters/-/zigbee-shepherd-converters-8.0.10.tgz", + "integrity": "sha512-d45yVA4MIIvNTyw3K3BTUd61GOEP163ePYfKN4tfr+bwBVVhWrtWazQWuaxjxpte23feLc9ft24200KCz0rKhA==", "requires": { "chai": "*", "debounce": "*", diff --git a/package.json b/package.json index bff21f379..f17cde1f7 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "zcl-id": "git+https://github.com/Koenkk/zcl-id.git#4fa75c92424cd070a3bf6e1f4640b1e3ad8f802d", "ziee": "*", "zigbee-shepherd": "git+https://github.com/Koenkk/zigbee-shepherd.git#a8b5828200140adf4de83457508576f6879f7ec1", - "zigbee-shepherd-converters": "8.0.9", + "zigbee-shepherd-converters": "8.0.10", "zive": "*" }, "devDependencies": { diff --git a/test/devicePublish.test.js b/test/devicePublish.test.js index 23cad3035..b22a97759 100644 --- a/test/devicePublish.test.js +++ b/test/devicePublish.test.js @@ -827,4 +827,32 @@ describe('DevicePublish', () => { '0x00000001', {state: 'OFF', brightness: 0}); }); + + it('Specifc ZNCLDJ11LM test', async () => { + zigbee.publish.mockClear(); + zigbee.getDevice = () => ({modelId: 'lumi.curtain'}); + devicePublish.onMQTTMessage('zigbee2mqtt/0x00000001/set', JSON.stringify({state: 'OPEN'})); + expect(zigbee.publish).toHaveBeenNthCalledWith(1, + '0x00000001', 'device', 'genAnalogOutput', 'write', + 'foundation', [{attrId: 0x0055, dataType: 0x39, attrData: 100}], cfg.default, null, expect.any(Function) + ); + + devicePublish.onMQTTMessage('zigbee2mqtt/0x00000001/set', JSON.stringify({position: 10})); + expect(zigbee.publish).toHaveBeenNthCalledWith(2, + '0x00000001', 'device', 'genAnalogOutput', 'write', + 'foundation', [{attrId: 0x0055, dataType: 0x39, attrData: 10}], cfg.default, null, expect.any(Function) + ); + + devicePublish.onMQTTMessage('zigbee2mqtt/0x00000001/set', JSON.stringify({state: 'CLOSE'})); + expect(zigbee.publish).toHaveBeenNthCalledWith(3, + '0x00000001', 'device', 'genAnalogOutput', 'write', + 'foundation', [{attrId: 0x0055, dataType: 0x39, attrData: 0}], cfg.default, null, expect.any(Function) + ); + + devicePublish.onMQTTMessage('zigbee2mqtt/0x00000001/set', JSON.stringify({state: 'STOP'})); + expect(zigbee.publish).toHaveBeenNthCalledWith(4, + '0x00000001', 'device', 'closuresWindowCovering', 'stop', + 'functional', {}, cfg.default, null, expect.any(Function) + ); + }); });