mirror of
https://github.com/esphome/esphome.git
synced 2025-11-19 00:05:43 +00:00
7665a220a0e18c19d35a4a476e15e3e828ecb08f
For printf formatting, a check is done to see if the number of
arguments matches the number of printf formatting placeholders.
The escape code `%%` that is used for representing a literal `%`
is also counted as a placeholder, but no argument will be provided
for that one.
This makes it impossible to use something like `("%f%%", percentage)`
in the code. In such case, one gets the error:
`Found 2 printf-patterns (%f, %%), but 1 args were given!`
This commit fixes this behavior by omitting the `%%` from the matches.
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
ESPHome

Documentation: https://esphome.io/
For issues, please go to the issue tracker.
For feature requests, please see feature requests.
Description
Languages
C++
64.5%
Python
35.3%
C
0.1%
