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

Add max_attempts to get_local_time #103

Merged
merged 4 commits into from
Jul 21, 2024

Conversation

colonwq
Copy link

@colonwq colonwq commented Jun 4, 2024

get_local_time() calls get_strftime() which calls connect().
connect() defaults to max_attempts=10 to connect to the wifi.
This patch allows the user to pass max_attempts to get_localtime() which will be passed to get_strftime() and used by connect().
Not setting the max_attempts value in get_local_time() uses the default max_attempts=10.
Not setting the max_attempts value in get_strftime() uses the default max_attempts=10

@FoamyGuy
Copy link
Contributor

This has failing actions due to some code formatting things.

The easiest way to resolves the actions issues is to setup pre-commit locally and run it on this branch. We have a learn guide page that covers the process here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code

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.

This change looks good to me. I tested it successfully on a Pyportal Titano.

I added the max_attempts arg to the get_local_time() function on the base class too which just passes it thru to the function of the same name on the network class.

Thanks for adding this functionality @colonwq

@FoamyGuy FoamyGuy merged commit 9c288c6 into adafruit:main Jul 21, 2024
1 check passed
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jul 22, 2024
Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 7.1.4 from 7.1.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#169 from Jahor/fix_dhcp_expiration

Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 2.1.0 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#103 from colonwq/update_get_local_time
  > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#101 from justmobilize/fix-readme-requirements

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