Skip to content

Commit

Permalink
Resend cached states on MQTT reconnect. Koenkk#105
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Jun 11, 2018
1 parent cd13286 commit 3c062a3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ class Controller {
}
});
}

// Resend all cached states.
this.zigbee.getAllClients().forEach((device) => {
if (this.stateCache.hasOwnProperty(device.ieeeAddr)) {
this.mqttPublishDeviceState(device.ieeeAddr, this.stateCache[device.ieeeAddr], false);
}
});
}

softResetTimeout(start) {
Expand Down

0 comments on commit 3c062a3

Please sign in to comment.