In situations where a registered sonoff device becomes offline or it was unable to acknowledge a packet due to intermittent wifi drop, the message will remain in device.messages forever.
Since message.sequence is a timestamp, a periodic timer could be implemented to clear stale messages (older than X minutes for example).
I have two more questions:
- What happens to devices that were not alive more than X minutes? Are they removed from devices list?
- Shouldn't the API server return an error code when you try to control a device that is not currently active?
In situations where a registered sonoff device becomes offline or it was unable to acknowledge a packet due to intermittent wifi drop, the message will remain in device.messages forever.
Since message.sequence is a timestamp, a periodic timer could be implemented to clear stale messages (older than X minutes for example).
I have two more questions: