Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code.py to handle RTC and NTP #36

Merged
merged 10 commits into from
May 10, 2024

Conversation

VPTechOps
Copy link
Contributor

Add support to set RTC from NTP with local timezone and DST support

@VPTechOps
Copy link
Contributor Author

VPTechOps commented Mar 17, 2024

I left the NTP server as pool.ntp.org. I didn't know if there was some other suggested value such as: us.pool.ntp.org, ntp.org, time.cloudflare.com, time.google.com etc. that we should use

@dhalbert
Copy link
Contributor

To fix your formatting problems, see about using pre-commit: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code

@VPTechOps
Copy link
Contributor Author

VPTechOps commented Mar 18, 2024

Thanks, Dan, for the pointer to pre-commit. It's going to take some time for me to figure out how to do all of that, since all the instruction seem to be Linux/Unix-based. I'm using a Windows machine and UltraEdit and GitKraken. Those line endings are a killer. I'll also have to figure out how to make all the libraries available so I can run pre-commit locally.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added one commit to this to make it fallback and continue if the user does not have a WIFI network configured so that this feature is truly optional.

The latest version looks good to me. I tested the updated example successfully on the MEMENTO hardware with 9.0.4.

@FoamyGuy FoamyGuy merged commit 40e88ed into adafruit:main May 10, 2024
1 check passed
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 11, 2024
Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes to 2.8.3 from 2.8.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#72 from RetiredWizard/sparkline

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyCamera to 1.3.1 from 1.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyCamera#36 from VPTechOps/Add-RTC-set-from-NTP

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants