Skip to content

Use correct format replacement when logging LED RGB values - #176

Open
RealOrangeOne wants to merge 1 commit into
LocalBytes:mainfrom
RealOrangeOne:fix-log-format
Open

Use correct format replacement when logging LED RGB values#176
RealOrangeOne wants to merge 1 commit into
LocalBytes:mainfrom
RealOrangeOne:fix-log-format

Conversation

@RealOrangeOne

Copy link
Copy Markdown
/data/packages/90d066c3/packages/localdeck-codegen/esphome-localdeck.yaml:633:31: warning: format '%d' expects argument of type 'int', but argument 5 has type 'double' [-Wformat=]
  633 |           ESP_LOGD("set_led_rgb", "%d, %d, %d", r,g,b);
      |                               ^~~~~~~~~~~~
../src/esphome/core/log.h:83:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
   83 | #define ESPHOME_LOG_FORMAT(format) format
      |                                    ^~~~~~
../src/esphome/core/log.h:163:28: note: in expansion of macro 'esph_log_d'
  163 | #define ESP_LOGD(tag, ...) esph_log_d(tag, __VA_ARGS__)
      |                            ^~~~~~~~~~

I believe the correct behaviour is to format them as a float (%f).

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.

1 participant