Open porkupan opened 9 years ago
Interesting! This is super simple to add, Ill throw a pr up in a few and ping you on it if you are willing to test!
Sure. But it's very easy to test, just switch from Mongo to REST API, and watch the battery status stop updating. Then delete all the entries created via Mongo API, and watch the battery status show correctly. As long as there are any devicestatus entries with empty "created_at" field in the table, the Nightscout is going to "ignore" entries with non-empty "created_at".
I can test it for you quickly, but I can't always get a hold of the "subject", so it may take a few hours.
When using the Mongo API directly, the xDrip logs devicestatus entries with an empty "created_at" timestamp field. This confuses the Nightscout site when switching from Mongo API to REST API. The REST API always fills out the "created_at" field. When obtaining the current battery status, the Nightscout treats the last entry with empty timestamp as the most recent (probably a bug in Nightscout code).
xDrip can avoid this confusion by always filling out the timestamp.