-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Introduce parse_number() helper function #2659
Conversation
Hey there @buxtronix, mind taking a look at this pull request as it has been labeled with an integration ( |
Hey there @andreashergert1984, mind taking a look at this pull request as it has been labeled with an integration ( |
Hey there @0hax, mind taking a look at this pull request as it has been labeled with an integration ( |
Hey there @ssieb, mind taking a look at this pull request as it has been labeled with an integration ( |
Hey there @netmikey, mind taking a look at this pull request as it has been labeled with an integration ( |
Hey there @glmnet, mind taking a look at this pull request as it has been labeled with an integration ( |
Hey there @OttoWinter, mind taking a look at this pull request as it has been labeled with an integration ( |
73373c5
to
3a870e9
Compare
What does this implement/fix?
This is the first in a series to clean-up
helpers.h
andhelpers.cpp
, and to provide consistently-named, generic helper functions. Final result will look something like this (but note that not everything in there is working/tested yet).Introduce the
parse_number()
template function that properly parses a decimal number:std::string
and C-style stringsoptional<T>
Convert all uses of the existing
parse_int()
andparse_float()
helpers, and drops them.Types of changes
Related issue or feature (if applicable): fixes
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#
Test Environment
Example entry for
config.yaml
:# Example config.yaml
Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: