hencou / esphome_components

Collection of own ESPhome components
25 stars 15 forks source link

Failing to compile, error: 'to_string' is not a member of 'std' #12

Closed shbatm closed 2 years ago

shbatm commented 2 years ago

Failing to compile with latest changes.

I tried wiping the build folder and cleaning build files to make sure it wasn't a caching issue.

ESPHome v2022.5.0

src/esphome/components/mi/light/mi_light.cpp: In member function 'virtual void esphome::mi::MiLight::setup_state(esphome::light::LightState*)':
src/esphome/components/mi/light/mi_light.cpp:93:61: error: 'to_string' is not a member of 'std'
           state_->add_effects({new light::LambdaLightEffect(std::to_string(i), [=](bool initial_run) -> void {
                                                             ^
src/esphome/components/mi/light/mi_light.cpp:93:61: note: suggested alternative:
In file included from src/esphome/core/preferences.h:6:0,
                 from src/esphome/core/application.h:6,
                 from src/esphome/components/api/api_connection.h:4,
                 from src/esphome.h:3,
                 from src/esphome/components/mi/light/mi_light.cpp:1:
src/esphome/core/helpers.h:256:20: note:   'esphome::to_string'
 inline std::string to_string(const std::string &val) { return val; }
                    ^
src/esphome/components/mi/light/mi_light.cpp:98:12: error: no matching function for call to 'esphome::light::LightState::add_effects(<brace-enclosed initializer list>)'
           });
            ^
In file included from src/esphome/core/application.h:34:0,
                 from src/esphome/components/api/api_connection.h:4,
                 from src/esphome.h:3,
                 from src/esphome/components/mi/light/mi_light.cpp:1:
src/esphome/components/light/light_state.h:127:8: note: candidate: void esphome::light::LightState::add_effects(const std::vector<esphome::light::LightEffect*>&)
   void add_effects(const std::vector<LightEffect *> &effects);
        ^
src/esphome/components/light/light_state.h:127:8: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<esphome::light::LightEffect*>&'
Compiling /data/esp32-milight-bridge/.pioenvs/esp32-milight-bridge/src/esphome/components/restart/button/restart_button.cpp.o
*** [/data/esp32-milight-bridge/.pioenvs/esp32-milight-bridge/src/esphome/components/mi/light/mi_light.cpp.o] Error 1
========================= [FAILED] Took 22.35 seconds =========================