CodeForAfrica / sensors.AFRICA-api

The sensors.AFRICA API receiving, storing, and processing data received from sensors across the continentent. Accessible at https://api.sensors.africa/
https://api.sensors.africa/
18 stars 7 forks source link

last_data_received_at should be based on last sent PM sensor data #42

Closed karimkawambwa closed 5 years ago

karimkawambwa commented 5 years ago

Description

Sometimes the sensor stops sending PM data but keeps sending humidity/temperature values and therefore we miss the PM data. This PR makes a change to prioritize caching of last received based on the PM data.

Fixes # (issue)

Type of change

Checklist:

karimkawambwa commented 5 years ago

👍 @karimkawambwa

Thinking out loud, shouldn't there be a limit to this? I mean if a sensor hasn't send PM data in 3 months while we're still receiving temp & humidity data, should we still report that the last time we received data from this node was 3 months ago?

@kilemensi I think that will probably deserve another variable to track. Thanks for raising that issue, I will plan to add that variable incase its needed or that case happens. (aka for debug purposes)