lubeda / EspHoMaTriXv2

A simple DIY status display with a 8x32 RGB LED matrix, implemented with esphome.io and Home Assistant.
MIT License
276 stars 25 forks source link

Fix percent logging #97

Closed trvrnrth closed 11 months ago

trvrnrth commented 11 months ago
In file included from src/esphome/components/sensor/sensor.h:3,
                 from src/esphome/components/adc/adc_sensor.h:6,
                 from src/esphome.h:3,
                 from src/esphome/components/ehmtxv2/EHMTX.cpp:1:
src/esphome/components/ehmtxv2/EHMTX.cpp: In member function 'void esphome::EHMTX::show_gauge(int, int, int, int, int, int, int)':
src/esphome/components/ehmtxv2/EHMTX.cpp:267:21: error: format '%d' expects argument of type 'int', but argument 5 has type 'double' [-Werror=format=]
       ESP_LOGD(TAG, "show_gauge 2 color %d", round(percent));
                     ^~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:152:28: note: in expansion of macro 'esph_log_d'
 #define ESP_LOGD(tag, ...) esph_log_d(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX.cpp:267:7: note: in expansion of macro 'ESP_LOGD'
       ESP_LOGD(TAG, "show_gauge 2 color %d", round(percent));
       ^~~~~~~~
cc1plus: some warnings being treated as errors
*** [.pioenvs/mobile-pixel-clock/src/esphome/components/ehmtxv2/EHMTX.o] Error 1