Update zigbee-herdsman-converters to 12.0.148

* Update zigbee-herdsman-converters to 12.0.148

* Update publish.test.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
This commit is contained in:
github-actions[bot]
2020-07-22 23:32:38 +02:00
committed by GitHub
co-authored by github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Koen Kanters
parent 2d3ab1cf8a
commit a01048487d
3 changed files with 21 additions and 8 deletions
+3 -3
View File
@@ -14711,9 +14711,9 @@
}
},
"zigbee-herdsman-converters": {
"version": "12.0.147",
"resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-12.0.147.tgz",
"integrity": "sha512-WlNkN5xG+HdS1hZ5jTjR2vFii1OfOqTFUEQ+uZg06L7V1TucHRPlQ4AMY0WUQksnX2uuRqwehA3iuyszZjBAOg==",
"version": "12.0.148",
"resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-12.0.148.tgz",
"integrity": "sha512-H/+5UUU+tPyPdqv9ka7gPL8XBlILg+Ve9JtkzdN2w4IiICsGrtlP6EKaiKGDC6sbftJVqa/7YgtTJd2aB1PTqw==",
"requires": {
"axios": "^0.19.2",
"https-proxy-agent": "^5.0.0",
+1 -1
View File
@@ -48,7 +48,7 @@
"winston": "^3.3.3",
"winston-syslog": "^2.4.4",
"zigbee-herdsman": "0.12.108",
"zigbee-herdsman-converters": "12.0.147"
"zigbee-herdsman-converters": "12.0.148"
},
"devDependencies": {
"eslint": "*",
+17 -4
View File
@@ -980,15 +980,28 @@ describe('Publish', () => {
// Turn bulb off so that the bulb gets a state.
await MQTT.events.message('zigbee2mqtt/bulb_color/set', JSON.stringify({state: 'OFF'}));
await flushPromises();
expect(MQTT.publish).toHaveBeenCalledTimes(1);
expect(MQTT.publish).toHaveBeenNthCalledWith(1,
'zigbee2mqtt/bulb_color',
JSON.stringify({state: 'OFF', brightness: 0}),
{retain: false, qos: 0}, expect.any(Function)
);
// Toggle again, now that we have state it should publish state ON
// Toggle again, now that we have state it should publish state ON and retrieve the brightness from the bulb.
endpoint.read.mockImplementationOnce((cluster, attrs) => {
if (cluster === 'genLevelCtrl' && attrs.includes('currentLevel')) {
return {currentLevel: 100};
}
});
await MQTT.events.message('zigbee2mqtt/bulb_color/set', JSON.stringify({state: 'TOGGLE'}));
await flushPromises();
expect(endpoint.command).toHaveBeenCalledTimes(3);
expect(MQTT.publish).toHaveBeenCalledTimes(2);
expect(MQTT.publish.mock.calls[1][0]).toStrictEqual('zigbee2mqtt/bulb_color');
expect(JSON.parse(MQTT.publish.mock.calls[1][1])).toStrictEqual({state: 'ON', brightness: 0});
expect(MQTT.publish.mock.calls[1][2]).toStrictEqual({"qos": 0, "retain": false});
expect(MQTT.publish).toHaveBeenNthCalledWith(2,
'zigbee2mqtt/bulb_color',
JSON.stringify({state: 'ON', brightness: 100}),
{retain: false, qos: 0}, expect.any(Function)
);
});
it('Should publish messages with options disableDefaultResponse', async () => {