ericklein / air_quality

displays and logs local indoor and outdoor weather and air quality information
MIT License
0 stars 0 forks source link

Parse timezone from OWM data #39

Closed ericklein closed 1 year ago

ericklein commented 2 years ago

Could one use the timezone from OWM data to automatically set the time zone in the NTP set function?

ericklein commented 2 years ago

would require re-arranging functions in setup(), e.g. one time run.

ericklein commented 2 years ago

will not fix, OWM data is not real time accurate

ericklein commented 2 years ago

since logging destination is timestamping independently, using OWM time on screen, even if off by ~ 1 minute, would not impact anything. As long as the AQ device isn't also being used as a clock :)

ericklein commented 2 years ago

Bumping priority to address before Fall. I'll work on this when I open up more of the OWM data for the new UI.

ericklein commented 1 year ago

Using OWM Current Weather API timezone field to get local UTC offset. If that is not available, use the backup time zone set in config.h.

I modified aq_network.cpp and aq_network.h to not automatically set UTC time when initializing a network connection, instead adding a new setTime function that allows the UTC offset to be passed in. We don't know the UTC offset until we call the OWM Current Weather API. One we have that, or not, we can set the time.