diff --git a/lib/extension/homeassistant.js b/lib/extension/homeassistant.js index 3747bab8..7855a0a0 100644 --- a/lib/extension/homeassistant.js +++ b/lib/extension/homeassistant.js @@ -621,6 +621,7 @@ const mapping = { 'HLD812-Z-SC': [configurations.light_brightness], 'BY 285 C': [configurations.light_brightness_colortemp_colorxy], 'HS1RC-M': [configurations.sensor_action, configurations.sensor_battery], + 'SWO-WDS1PA': [configurations.binary_sensor_contact], }; Object.keys(mapping).forEach((key) => { diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 9b9137ce..26640693 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -5993,9 +5993,9 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "uglify-js": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.1.tgz", - "integrity": "sha512-kI+3c+KphOAKIikQsZoT2oDsVYH5qvhpTtFObfMCdhPAYnjSvmW4oTWMhvDD4jtAGHJwztlBXQgozGcq3Xw9oQ==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.2.tgz", + "integrity": "sha512-imog1WIsi9Yb56yRt5TfYVxGmnWs3WSGU73ieSOlMVFwhJCA9W8fqFFMMj4kgDqiS/80LGdsYnWL7O9UcjEBlg==", "dev": true, "optional": true, "requires": { @@ -6447,9 +6447,9 @@ } }, "zigbee-shepherd-converters": { - "version": "8.0.11", - "resolved": "https://registry.npmjs.org/zigbee-shepherd-converters/-/zigbee-shepherd-converters-8.0.11.tgz", - "integrity": "sha512-w3EmkKhiiNiH8d3K3s8vPm125OfT+vrWVV6rIhPbpMcODzhclL2trSB7IWFlsjxaAVIroHz8DkAUIbscbd3MDw==", + "version": "8.0.12", + "resolved": "https://registry.npmjs.org/zigbee-shepherd-converters/-/zigbee-shepherd-converters-8.0.12.tgz", + "integrity": "sha512-2dsFH4ZqkG8l7cVCxkY+5bRAq7X2yLC4eLmNm5I47yFfF0uZYw9BsisMJndZDT7x4IfDSUZC/5WoiI8LfuhnxQ==", "requires": { "chai": "*", "debounce": "*", diff --git a/package.json b/package.json index aeb82f86..72dac511 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.11", + "zigbee-shepherd-converters": "8.0.12", "zive": "*" }, "devDependencies": { diff --git a/test/devicePublish.test.js b/test/devicePublish.test.js index 0ddc1649..38e0f522 100644 --- a/test/devicePublish.test.js +++ b/test/devicePublish.test.js @@ -84,7 +84,17 @@ describe('DevicePublish', () => { '0x00000002', {state: 'ON'}); await wait(10); - expect(zigbee.publish).toHaveBeenCalledTimes(1); + expect(zigbee.publish).toHaveBeenCalledTimes(2); + expect(zigbee.publish).toHaveBeenNthCalledWith(2, + '0x00000002', + 'device', + 'genLevelCtrl', + 'read', + 'foundation', + [{attrId: 0}], + cfg.default, + null, + expect.any(Function)); }); it('Should publish messages to zigbee devices when brightness is in %', async () => { @@ -323,7 +333,11 @@ describe('DevicePublish', () => { '0x00000012', {state: 'ON'}); await wait(10); - expect(zigbee.publish).toHaveBeenCalledTimes(3); + expect(zigbee.publish).toHaveBeenCalledTimes(4); + expect(zigbee.publish.mock.calls[2][2]).toBe('genLevelCtrl'); + expect(zigbee.publish.mock.calls[2][3]).toBe('read'); + expect(zigbee.publish.mock.calls[3][2]).toBe('lightingColorCtrl'); + expect(zigbee.publish.mock.calls[3][3]).toBe('read'); } ); @@ -767,9 +781,11 @@ describe('DevicePublish', () => { expect(zigbee.publish.mock.calls[1][2]).toBe('lightingColorCtrl'); expect(zigbee.publish.mock.calls[1][3]).toBe('moveToColor'); await wait(10); - expect(zigbee.publish).toHaveBeenCalledTimes(3); - expect(zigbee.publish.mock.calls[2][2]).toBe('lightingColorCtrl'); + expect(zigbee.publish).toHaveBeenCalledTimes(4); + expect(zigbee.publish.mock.calls[2][2]).toBe('genLevelCtrl'); expect(zigbee.publish.mock.calls[2][3]).toBe('read'); + expect(zigbee.publish.mock.calls[3][2]).toBe('lightingColorCtrl'); + expect(zigbee.publish.mock.calls[3][3]).toBe('read'); }); it('Should set state with brightness before color', async () => {