Beaky2000 / esphome-p1mini

ESPHome external component for reading P1 data from (Swedish) electricity meters
MIT License
128 stars 26 forks source link

Error compiling. #7

Closed putteg closed 1 year ago

putteg commented 1 year ago

Hey, I get an error compiling this code. Esphome version: [v2022.11.5]

Error:

Generating LD script /data/slimmelezer/.pioenvs/slimmelezer/ld/local.eagle.app.v6.common.ld Compiling /data/slimmelezer/.pioenvs/slimmelezer/liba46/ESPAsyncTCP-esphome/AsyncPrinter.cpp.o Compiling /data/slimmelezer/.pioenvs/slimmelezer/liba46/ESPAsyncTCP-esphome/ESPAsyncTCP.cpp.o /config/esphome/slimmelezer.yaml: In lambda function: /config/esphome/slimmelezer.yaml:107:7: error: no matching function for call to 'P1Reader::P1Reader(esphome::uart::ESP8266UartComponent&, esphome::template_::TemplateNumber&, esphome::gpio::GPIOSwitch&, esphome::gpio::GPIOSwitch&, esphome::gpio::GPIOBinarySensor*&)' 107 ); ^ In file included from src/main.cpp:70: src/p1mini.h:35:3: note: candidate: 'P1Reader::P1Reader(unsigned int, esphome::uart::UARTComponent, esphome::gpio::GPIOSwitch, esphome::gpio::GPIOSwitch*)' 35 P1Reader(unsigned int minimum_period_ms, ^~~~ src/p1mini.h:35:3: note: candidate expects 4 arguments, 5 provided src/p1mini.h:25:7: note: candidate: 'constexpr P1Reader::P1Reader(const P1Reader&)' 25 class P1Reader : public Component, public UARTDevice { ^~~~ src/p1mini.h:25:7: note: candidate expects 1 argument, 5 provided src/p1mini.h:25:7: note: candidate: 'constexpr P1Reader::P1Reader(P1Reader&&)' src/p1mini.h:25:7: note: candidate expects 1 argument, 5 provided /config/esphome/slimmelezer.yaml:136:7: error: could not convert '{, , , , , , , , , , , , , , , , , , , , , , , , , }' from '' to 'std::vector<esphome::sensor::Sensor*>' 136 }; ^

Compiling /data/slimmelezer/.pioenvs/slimmelezer/liba46/ESPAsyncTCP-esphome/ESPAsyncTCPbuffer.cpp.o *** [/data/slimmelezer/.pioenvs/slimmelezer/src/main.cpp.o] Error 1

Beaky2000 commented 1 year ago

I get the feeling that you are combining the .h file from this project with the .yaml from another project. (Some parts of) The yaml must match the .h file for this to work...