nekromant / esphome-lctech-4chanel-modules

ESPHome configs for LC-tech 4 channel modules.
12 stars 6 forks source link

compiling error with hassio ESPHome #1

Closed m1588 closed 4 years ago

m1588 commented 5 years ago

I have created LCRelay.h and however I am getting an error compiling fw. Could you point me out what is wring? thansk!

Compiling /data/r01/.pioenvs/r01/src/main.cpp.o
src/main.cpp:118:3: warning: multi-line comment [-Wcomment]
//   lambda: !lambda "auto r1 = new LCRelay(id(uart1), 1);\nauto r2 = new LCRelay(id(uart1),\
^
In file included from src/main.cpp:19:0:
src/lcrelay.h:23:52: error: expected class-name before ',' token
class LCRelay : public Component, public UARTDevice, public switch_::Switch {
^
src/lcrelay.h:27:27: error: expected ')' before '*' token
LCRelay(UARTComponent *parent, int relay): UARTDevice(parent) {
^
src/lcrelay.h: In member function 'virtual void LCRelay::write_state(bool)':
src/lcrelay.h:43:11: error: 'class LCRelay' has no member named 'write_array'
this->write_array(msg, sizeof(msg));
^
src/lcrelay.h:44:11: error: 'class LCRelay' has no member named 'write_array'
this->write_array(msg, sizeof(msg));
^
src/main.cpp: In lambda function:
src/main.cpp:137:37: error: no matching function for call to 'LCRelay::LCRelay(esphome::uart::UARTComponent*&, int)'
auto r1 = new LCRelay(uart1, 1);
^
src/main.cpp:137:37: note: candidates are:
In file included from src/main.cpp:19:0:
src/lcrelay.h:23:7: note: LCRelay::LCRelay()
class LCRelay : public Component, public UARTDevice, public switch_::Switch {
^
src/lcrelay.h:23:7: note:   candidate expects 0 arguments, 2 provided
src/lcrelay.h:23:7: note: LCRelay::LCRelay(const LCRelay&)
src/lcrelay.h:23:7: note:   candidate expects 1 argument, 2 provided
src/lcrelay.h:23:7: note: LCRelay::LCRelay(LCRelay&&)
src/lcrelay.h:23:7: note:   candidate expects 1 argument, 2 provided
src/main.cpp:138:37: error: no matching function for call to 'LCRelay::LCRelay(esphome::uart::UARTComponent*&, int)'
auto r2 = new LCRelay(uart1, 2);
^
src/main.cpp:138:37: note: candidates are:
In file included from src/main.cpp:19:0:
src/lcrelay.h:23:7: note: LCRelay::LCRelay()
class LCRelay : public Component, public UARTDevice, public switch_::Switch {
^
src/lcrelay.h:23:7: note:   candidate expects 0 arguments, 2 provided
src/lcrelay.h:23:7: note: LCRelay::LCRelay(const LCRelay&)
src/lcrelay.h:23:7: note:   candidate expects 1 argument, 2 provided
src/lcrelay.h:23:7: note: LCRelay::LCRelay(LCRelay&&)
src/lcrelay.h:23:7: note:   candidate expects 1 argument, 2 provided
src/main.cpp:139:37: error: no matching function for call to 'LCRelay::LCRelay(esphome::uart::UARTComponent*&, int)'
auto r3 = new LCRelay(uart1, 3);
^
src/main.cpp:139:37: note: candidates are:
In file included from src/main.cpp:19:0:
src/lcrelay.h:23:7: note: LCRelay::LCRelay()
class LCRelay : public Component, public UARTDevice, public switch_::Switch {
^
src/lcrelay.h:23:7: note:   candidate expects 0 arguments, 2 provided
src/lcrelay.h:23:7: note: LCRelay::LCRelay(const LCRelay&)
src/lcrelay.h:23:7: note:   candidate expects 1 argument, 2 provided
src/lcrelay.h:23:7: note: LCRelay::LCRelay(LCRelay&&)
src/lcrelay.h:23:7: note:   candidate expects 1 argument, 2 provided
src/main.cpp:140:37: error: no matching function for call to 'LCRelay::LCRelay(esphome::uart::UARTComponent*&, int)'
auto r4 = new LCRelay(uart1, 4);
^
src/main.cpp:140:37: note: candidates are:
In file included from src/main.cpp:19:0:
src/lcrelay.h:23:7: note: LCRelay::LCRelay()
class LCRelay : public Component, public UARTDevice, public switch_::Switch {
^
src/lcrelay.h:23:7: note:   candidate expects 0 arguments, 2 provided
src/lcrelay.h:23:7: note: LCRelay::LCRelay(const LCRelay&)
src/lcrelay.h:23:7: note:   candidate expects 1 argument, 2 provided
src/lcrelay.h:23:7: note: LCRelay::LCRelay(LCRelay&&)
src/lcrelay.h:23:7: note:   candidate expects 1 argument, 2 provided
src/main.cpp:145:29: error: could not convert '{r1, r2, r3, r4}' from '<brace-enclosed initializer list>' to 'std::vector<esphome::switch_::Switch*>'
return {r1, r2, r3, r4};
^
src/main.cpp:146:3: warning: control reaches end of non-void function [-Wreturn-type]
});
^
*** [/data/r01/.pioenvs/r01/src/main.cpp.o] Error 1
nekromant commented 5 years ago

Hm, could you please post your pio/esphome versions? I guess API might've changed, so I'll have to look into it myself.

nekromant commented 4 years ago

Hi there. I've just updated the repo and posted the alternative firmware for the nuvoton that allows button & leds control as well. The issue you are reporting should be fixed now.