/config/esphome/m5atom-lite.yaml: In lambda function:
/config/esphome/m5atom-lite.yaml:39:54: error: 'stoi' is not a member of 'std'
id(PowerMeter_sensor_instant_power).publish_state(std::stoi (b, nullptr));
It takes the address of the first character of the string – basically a hacky way of converting the C++ string object to a C-style string for the log macros. Using b.c_str() is better.
Do you know why I get error: 'parse_int' was not declared in this scope when compiling to esp32? I’m trying to replace std::stoi because it isn’t apparently included in the esp32 libs.
Thanks for the suggestion. Does it work for you on esp32? I just get error: cannot convert 'const value_type {aka const std::__cxx11::basic_string<char>}' to 'const char*' for argument '1' to 'int atoi(const char*)'. I know nothing about C++, but apparently I can’t just replace stoi with atoi. I guess I need to troubleshoot this on github.