tfyoung / esphome-junctek_kgf

Component for esphome to read status from a Junctek KG-F coulometer/battery monitor via UART
MIT License
25 stars 15 forks source link

Error On Ha Esphome #5

Closed thecivvie closed 1 year ago

thecivvie commented 1 year ago

I am getting this error when compiling on home assistant

src/esphome/components/junctek_kgf/junctek_kgf.cpp: In function 'int getval(const char*&)': src/esphome/components/junctek_kgf/junctek_kgf.cpp:19:46: error: exception handling disabled, use -fexceptions to enable throw std::runtime_error("invalid number"); ^ In file included from src/esphome/components/sensor/sensor.h:3, from src/esphome/components/junctek_kgf/junctek_kgf.h:4, from src/esphome/components/junctek_kgf/junctek_kgf.cpp:1: src/esphome/components/junctek_kgf/junctek_kgf.cpp: In member function 'void JuncTekKGF::handle_line()': src/esphome/components/junctek_kgf/junctek_kgf.cpp:125:42: error: 'e' was not declared in this scope ESP_LOGE("JunkTekKGF", "Error %s %s",e.what(), buffer); ^ src/esphome/core/log.h:123:89: note: in definition of macro 'esph_log_e' esp_log_printf_(ESPHOME_LOG_LEVEL_ERROR, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__) ^~~~~~~~~~~ src/esphome/components/junctek_kgf/junctek_kgf.cpp:125:5: note: in expansion of macro 'ESP_LOGE' ESP_LOGE("JunkTekKGF", "Error %s %s",e.what(), buffer); ^~~~~~~~ *** [/data/juncteks/.pioenvs/juncteks/src/esphome/components/junctek_kgf/junctek_kgf.cpp.o] Error 1 ========================= [FAILED] Took 11.33 seconds =========================

Any suggestions as to what to change.

tfyoung commented 1 year ago

Duplicate of #4