iot-smart-home-cloud
iot-smart-home-cloud copied to clipboard
If reconnect, disconnect event is fired after connect event.
https://github.com/GoogleCloudPlatform/iot-smart-home-cloud/blob/e65a1535d909639de37e8bdda81bbb8167eaed96/firebase/functions/device-cloud/online-state.js#L32
Should check also if logEntry.jsonPayload.status.code !== 6
because in this case disconnect event is fired after "real" connect event.
Example scenario if device is restarted.