1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-20 20:08:20 +00:00
Maurice Makaay 7665a220a0
Fix error when using %% in printf format. (#1713)
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>
2021-05-11 12:15:29 -03:00
2020-12-13 16:24:26 -03:00
2018-09-25 10:30:45 +02:00
2020-12-13 16:24:26 -03:00
2021-03-07 16:03:16 -03:00
2021-05-03 11:10:50 +12:00
2021-03-07 16:03:16 -03:00
2021-03-07 16:03:16 -03:00
2019-02-14 13:49:22 +01:00
2021-03-07 16:03:16 -03:00
2021-05-03 11:51:10 +12:00

ESPHome Build Status Discord Chat GitHub release

ESPHome Logo

Documentation: https://esphome.io/

For issues, please go to the issue tracker.

For feature requests, please see feature requests.

Description
No description provided
Readme Multiple Licenses 376 MiB
Languages
C++ 70.4%
Python 29.3%
C 0.1%