Repository navigation
Refuse non-finite floats instead of publishing nan or inf - #28
Merged
Merged
Conversation
homie_format_float() and homie_format_double() wrote "nan", "inf" or "-inf", and Property::setValue(float) published it, but the float payload grammar has no spelling for them. The formatters now return false with an empty string, and setValue() logs and keeps the previous value. A new suite runs the 434 float32 vectors shared with python-sdk and rust-sdk. Fixes #27. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vz59zZzRfxFkWjW16egZoy
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #27.
homie_format_float()andhomie_format_double()returnbool:false, with an empty string, for a NaN or infinity. Callers that ignore the result still compile.Property::setValue(float)logs and keeps the previous value for a non-finite input.test_homie_float_vectorsruns the 434 float32 vectors from rust-sdk'svectors/python-sdk/float32-format.json(c31562c, generated from python-sdk 0.26.0): all pass, including the three non-finite ones that expect no payload.test_property_publishchecks that a NaN or infinity leaves the published value at its previous21.4.esp32-firmware's
NodeProperty::set(float|double)needs the same guard once this is released.🤖 Generated with Claude Code
https://claude.ai/code/session_01Vz59zZzRfxFkWjW16egZoy