Skip to content

add float support to settings.toml and supervisor.get_setting()#10975

Merged
dhalbert merged 4 commits intoadafruit:mainfrom
dhalbert:settings-toml-float
May 4, 2026
Merged

add float support to settings.toml and supervisor.get_setting()#10975
dhalbert merged 4 commits intoadafruit:mainfrom
dhalbert:settings-toml-float

Conversation

@dhalbert
Copy link
Copy Markdown
Collaborator

@dhalbert dhalbert commented May 1, 2026

Add float support for settings.toml, so we can add several new controls for startup values, such as safe-mode delay, BLE startup delay, etc.

This code was developed with careful guiding of Claude Code using the Sonnet 4.6 model. Because this code must be allocation-free, there is some extra code for doing signed numbers beyond calling the basic float number parser.

Because ports/unix does not implement supervisor, a manual test was developed. I ran it and tested it. The original generated test used math.inf and math.nan, which are not available (#10974), and I worked around that.

Also I clarified some comments having to do with SETTINGS_ERR_*.

I fixed a couple of build problems which were unrelated to primary point of the PR.

@dhalbert dhalbert requested a review from tannewt May 3, 2026 17:05
Copy link
Copy Markdown
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

This looks fine to me.

Would you mind adding Zephyr native_sim tests? It should be able to test this.

@dhalbert
Copy link
Copy Markdown
Collaborator Author

dhalbert commented May 4, 2026

Would you mind adding Zephyr native_sim tests? It should be able to test this.

I will add this in another PR, but definitely will do it.

@dhalbert dhalbert merged commit 545fcc5 into adafruit:main May 4, 2026
665 checks passed
@dhalbert dhalbert deleted the settings-toml-float branch May 4, 2026 17:59
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.

2 participants