Another settings.toml update, slightly different approach #182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I decided to take a stab at reworking the examples in this library to work with settings.toml and didn't notice the existing pr #179.
I took a slightly different approach as I didn't actually make any functional changes to the core library. The library currently doesn't directly access the settings.py file but uses a dictionary that is passed in and I decided it was less breaking to simply modify the examples to build the passed in dictionary from settings.toml. I also left a fallback to reading the secrets.py file in the examples because I didn't know when/if any learn guides that might reference the examples would be updated.
I considered just tossing this out, once I spotted the existing PR but since the work was already done, I figured I'd throw it out there anyway. There are advantages to modifying the library to access the secrets directly from the settings.toml environment variable, particularly with regards to simplifying the usage of library and example programs, so I'm not sure my approach makes sense.
edit: I tested most of the example programs using an Arduino Nano Connect RP2040.