diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0967137ad..f8f0025ad 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -13193,9 +13193,9 @@ } }, "zigbee-herdsman-converters": { - "version": "14.0.413", - "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-14.0.413.tgz", - "integrity": "sha512-lDu8eBtzrSisSA7kGsO1/Puf0LMdE62Etp17PfRLZqr4+VYQue54413BfqNAXF0vjb1ryj2dWXEVfJOqtZnqfg==", + "version": "14.0.414", + "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-14.0.414.tgz", + "integrity": "sha512-McDZAqOYsyBrZTeAv1t4H1G8SNyo2+xdxjer9Qj1X7LvmMzxziwubcownTlcNsAbJgou4Clwg23x3gjhSpQaXQ==", "requires": { "axios": "^0.25.0", "buffer-crc32": "^0.2.13", diff --git a/package.json b/package.json index 77f6e419a..a1642ba8a 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "winston-syslog": "^2.5.0", "ws": "^8.4.2", "zigbee-herdsman": "0.14.13", - "zigbee-herdsman-converters": "14.0.413", + "zigbee-herdsman-converters": "14.0.414", "zigbee2mqtt-frontend": "0.6.71" }, "devDependencies": { diff --git a/test/receive.test.js b/test/receive.test.js index 0efae3685..fd188cdda 100755 --- a/test/receive.test.js +++ b/test/receive.test.js @@ -250,43 +250,7 @@ describe('Receive', () => { await flushPromises(); expect(MQTT.publish).toHaveBeenCalledTimes(1); expect(MQTT.publish.mock.calls[0][0]).toStrictEqual('zigbee2mqtt/button_double_key'); - expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({battery: 100, voltage: 3010}); - expect(MQTT.publish.mock.calls[0][2]).toStrictEqual({"qos": 0, "retain": false}); - }); - - it('Should handle a zigbee message with voltage 2850', async () => { - const device = zigbeeHerdsman.devices.WXKG02LM_rev1; - const data = {'65281': {'1': 2850}} - const payload = {data, cluster: 'genBasic', device, endpoint: device.getEndpoint(1), type: 'attributeReport', linkquality: 10}; - await zigbeeHerdsman.events.message(payload); - await flushPromises(); - expect(MQTT.publish).toHaveBeenCalledTimes(1); - expect(MQTT.publish.mock.calls[0][0]).toStrictEqual('zigbee2mqtt/button_double_key'); - expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({battery: 35, voltage: 2850}); - expect(MQTT.publish.mock.calls[0][2]).toStrictEqual({"qos": 0, "retain": false}); - }); - - it('Should handle a zigbee message with voltage 2650', async () => { - const device = zigbeeHerdsman.devices.WXKG02LM_rev1; - const data = {'65281': {'1': 2650}} - const payload = {data, cluster: 'genBasic', device, endpoint: device.getEndpoint(1), type: 'attributeReport', linkquality: 10}; - await zigbeeHerdsman.events.message(payload); - await flushPromises(); - expect(MQTT.publish).toHaveBeenCalledTimes(1); - expect(MQTT.publish.mock.calls[0][0]).toStrictEqual('zigbee2mqtt/button_double_key'); - expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({battery: 14, voltage: 2650}); - expect(MQTT.publish.mock.calls[0][2]).toStrictEqual({"qos": 0, "retain": false}); - }); - - it('Should handle a zigbee message with voltage 2000', async () => { - const device = zigbeeHerdsman.devices.WXKG02LM_rev1; - const data = {'65281': {'1': 2000}} - const payload = {data, cluster: 'genBasic', device, endpoint: device.getEndpoint(1), type: 'attributeReport', linkquality: 10}; - await zigbeeHerdsman.events.message(payload); - await flushPromises(); - expect(MQTT.publish).toHaveBeenCalledTimes(1); - expect(MQTT.publish.mock.calls[0][0]).toStrictEqual('zigbee2mqtt/button_double_key'); - expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({battery: 0, voltage: 2000}); + expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({battery: 46, voltage: 3010}); expect(MQTT.publish.mock.calls[0][2]).toStrictEqual({"qos": 0, "retain": false}); }); @@ -298,7 +262,7 @@ describe('Receive', () => { await flushPromises(); expect(MQTT.publish).toHaveBeenCalledTimes(1); expect(MQTT.publish.mock.calls[0][0]).toStrictEqual('zigbee2mqtt/occupancy_sensor'); - expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({'battery': 100, 'illuminance': 381, "illuminance_lux": 381, 'voltage': 3045, 'temperature': 19}); + expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({'battery': 56, 'illuminance': 381, "illuminance_lux": 381, 'voltage': 3045, 'temperature': 19}); expect(MQTT.publish.mock.calls[0][2]).toStrictEqual({"qos": 0, "retain": false}); });