In file included from src/main.cpp:18:0:
src/lccomponent.h:3:25: fatal error: esphome/log.h: No such file or directory
#include "esphome/log.h"
^
compilation terminated.
*** [.pioenvs/klingelknopf/src/main.cpp.o] Error 1
then i change the include in lccomponent.h to #include "esphome/core/log.h". but that leads to these errors:
In file included from src/main.cpp:18:0:
src/lccomponent.h:15:3: error: 'binary_sensor' does not name a type
binary_sensor::BinarySensor buttons[2];
^
src/lccomponent.h: In member function 'void LCButtons::update_button(uint8_t)':
src/lccomponent.h:33:5: error: 'buttons' was not declared in this scope
buttons[button - 1].publish_state(!value);
^
src/lccomponent.h: At global scope:
src/lccomponent.h:43:67: error: 'output' has not been declared
class LCFloatOutput : public Component, public UARTDevice, public output::FloatOutput {
^
src/lccomponent.h:43:75: error: expected '{' before 'FloatOutput'
class LCFloatOutput : public Component, public UARTDevice, public output::FloatOutput {
^
src/lccomponent.h:43:87: error: invalid type in declaration before '{' token
class LCFloatOutput : public Component, public UARTDevice, public output::FloatOutput {
^
src/lccomponent.h:44:2: error: expected primary-expression before 'public'
public:
^
src/lccomponent.h:44:2: error: expected '}' before 'public'
src/lccomponent.h:44:2: error: expected ',' or ';' before 'public'
src/lccomponent.h:49:31: error: expected ')' before '*' token
LCFloatOutput(UARTComponent *parent, const char prefix)
^
src/lccomponent.h:54:16: error: virt-specifiers in 'setup' not allowed outside a class definition
void setup() override {
^
src/lccomponent.h:57:33: error: virt-specifiers in 'write_state' not allowed outside a class definition
void write_state(float state) override {
^
src/lccomponent.h: In function 'void write_state(float)':
src/lccomponent.h:59:26: error: invalid use of 'this' in non-member function
LCRelay::send_packet(this, pre, v);
^
src/lccomponent.h:59:32: error: 'pre' was not declared in this scope
LCRelay::send_packet(this, pre, v);
^
src/lccomponent.h: At global scope:
src/lccomponent.h:61:1: error: expected declaration before '}' token
};
^
which i can circumvent via not including lccomponent.h.
thanks for your work!
i get these errors when i try to run it:
then i change the include in
lccomponent.h
to#include "esphome/core/log.h"
. but that leads to these errors:which i can circumvent via not including
lccomponent.h
.However i still dont get the switch to work :(
This is my config:
I also suspect that it should somehow be possible to run this w/o extra C code, but i also did not get that to run :/