adafruit / Adafruit_CircuitPython_PyPortal

CircuitPython driver for Adafruit PyPortal.
MIT License
45 stars 56 forks source link

Timezones cannot be an integer #11

Closed makermelissa closed 5 years ago

makermelissa commented 5 years ago

This is mainly a problem because the ESP32SPI secrets file uses the timezone as an integer which is causing PyPortal to crash. I noticed this when trying to use the OpenWeather example. Changing it to a string fixed it and I have submitted a PR to change it to a string by default, but it would still be nice to be able to use numbers.

ladyada commented 5 years ago

time stuff needs a bit of reworking - we'll also be updating it to use adafruit.io instead of a free service, so we don't overload the nice people at worldtimeapi!

anecdata commented 5 years ago

I think the issue with TZ offset numbers is that they're easier for people to remember sometimes than the strings, and definitely useful for concise output of a specific date-time, but they're often imprecise for specifying your real timezone behavior... you might have to change your secrets.py twice a year for daylight savings time or other local complications. More detail than you'd ever want at: https://data.iana.org/time-zones/theory.html

ladyada commented 5 years ago

we dont want to update for daylight savings, the goal here is to not have to do that - so i would prefer to stick to strings that fully determine what the time should be.

makermelissa commented 5 years ago

Ok, it has been updated in ESP32SPI to use a string by default now, so I'm ok with closing this if we're not going that route.

ladyada commented 5 years ago

thanks - this has been refactored for adafruit.io!