This commit is contained in:
Koen Kanters 2020-02-23 20:47:38 +01:00
parent 2a9d0d1875
commit dd82b29629
3 changed files with 23 additions and 4 deletions

6
npm-shrinkwrap.json generated
View File

@ -14744,9 +14744,9 @@
}
},
"zigbee-herdsman-converters": {
"version": "12.0.28",
"resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-12.0.28.tgz",
"integrity": "sha512-Ab/fL3DhvgogCBmKfVP4i5zj3+iMx9Cb59w2v0zAMJBZP/rfYg31+PzBbkPLrJCsWX+2aexsla1LaiKYQzV4iw==",
"version": "12.0.30",
"resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-12.0.30.tgz",
"integrity": "sha512-MHZAA8mO+hhI3zbNjHLcMIaF0tWrvCWidJB4Cn+QozdeVpZ77C3Jjr44177LO8OYbI1m6s0pHotaKrQlbkQt1g==",
"requires": {
"axios": "*",
"tar-stream": "*"

View File

@ -46,7 +46,7 @@
"semver": "*",
"winston": "*",
"zigbee-herdsman": "0.12.55",
"zigbee-herdsman-converters": "12.0.28"
"zigbee-herdsman-converters": "12.0.30"
},
"devDependencies": {
"eslint": "*",

View File

@ -186,6 +186,25 @@ describe('Device receive', () => {
expect(MQTT.publish.mock.calls[0][2]).toStrictEqual({"qos": 1, "retain": false});
});
it('WSDCGQ11LM pressure precision from non ZCL properties', async () => {
const device = zigbeeHerdsman.devices.WSDCGQ11LM;
settings.set(['devices', device.ieeeAddr, 'temperature_precision'], 1);
MQTT.publish.mockClear();
let payload = {data: {"65281":{"1":2985,"4":5032,"5":9,"6":[0,1],"10":0,"100":2345,"101":4608,"102":91552}}, cluster: 'genBasic', device, endpoint: device.getEndpoint(1), type: 'attributeReport', linkquality: 10};
await zigbeeHerdsman.events.message(payload);
await flushPromises();
expect(MQTT.publish).toHaveBeenCalledTimes(1);
expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({"battery":91,"voltage":2985,"temperature":23.5,"humidity":46.08,"pressure":915.5,"linkquality":10});
MQTT.publish.mockClear();
payload = {data: {"16":9354,"20":-1,"measuredValue":915}, cluster: 'msPressureMeasurement', device, endpoint: device.getEndpoint(1), type: 'attributeReport', linkquality: 10};
await zigbeeHerdsman.events.message(payload);
await flushPromises();
expect(MQTT.publish).toHaveBeenCalledTimes(1);
expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({"battery":91,"voltage":2985,"temperature":23.5,"humidity":46.08,"pressure":935.4,"linkquality":10});
});
it('Should handle a zigbee message with voltage 3010', async () => {
const device = zigbeeHerdsman.devices.WXKG02LM;
const data = {'65281': {'1': 3010}}