Add keepalive option for MQTT (#2767)

This commit is contained in:
Twan Coenraad
2020-01-17 21:38:46 +01:00
committed by Koen Kanters
parent 39ed95371e
commit dd0ca2a392
3 changed files with 8 additions and 0 deletions
+2
View File
@@ -57,6 +57,7 @@ describe('Controller', () => {
const configuration = {
base_topic: "zigbee2mqtt",
server: "mqtt://localhost",
keepalive: 30,
ca, cert, key,
password: 'pass',
user: 'user1',
@@ -69,6 +70,7 @@ describe('Controller', () => {
expect(MQTT.connect).toHaveBeenCalledTimes(1);
const expected = {
"will": {"payload": "offline", "retain": true, "topic": "zigbee2mqtt/bridge/state"},
keepalive: 30,
ca: Buffer.from([99, 97]),
key: Buffer.from([107, 101, 121]),
cert: Buffer.from([99, 101, 114, 116]),