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