CalvinSchwartz / esphome-influxdb

InfluxDBv2 custom component for ESPHome
MIT License
2 stars 2 forks source link

Build Error with change of http request #1

Closed CalvinSchwartz closed 2 months ago

CalvinSchwartz commented 2 months ago

The http feature got changes in ESPhome 2024.06 which breaks the http request feature used by this external component.

The component will be updated in the coming weeks, but it could take some time.

src/esphome/components/influxdb2/influxdb_writer.cpp: In member function 'virtual void esphome::influxdb::InfluxDBWriter::setup()': src/esphome/components/influxdb2/influxdb_writer.cpp:30:59: error: invalid new-expression of abstract class type 'esphome::http_request::HttpRequestComponent' 30 | this->request_ = new http_request::HttpRequestComponent(); | ^ In file included from src/esphome/components/influxdb2/influxdb_writer.h:9, from src/esphome/components/influxdb2/influxdb_writer.cpp:1: src/esphome/components/http_request/http_request.h:53:7: note: because the following virtual functions are pure within 'esphome::http_request::HttpRequestComponent': 53 | class HttpRequestComponent : public Component { | ^~~~~~~~~~~~~~~~~~~~ src/esphome/components/http_request/http_request.h:76:42: note: 'virtual std::shared_ptr<esphome::http_request::HttpContainer> esphome::http_request::HttpRequestComponent::start(std::string, std::string, std::string, std::__cxx11::list<esphome::http_request::Header>)' 76 | virtual std::shared_ptr<HttpContainer> start(std::string url, std::string method, std::string body, | ^~~~~ src/esphome/components/influxdb2/influxdb_writer.cpp:43:19: error: 'class esphome::http_request::HttpRequestComponent' has no member named 'set_headers' 43 | this->request_->set_headers(headers); | ^~~~~~~~~~~ src/esphome/components/influxdb2/influxdb_writer.cpp:44:19: error: 'class esphome::http_request::HttpRequestComponent' has no member named 'set_method' 44 | this->request_->set_method("GET"); | ^~~~~~~~~~ src/esphome/components/influxdb2/influxdb_writer.cpp:47:19: error: 'class esphome::http_request::HttpRequestComponent' has no member named 'set_url'; did you mean 'setup'? 47 | this->request_->set_url(this->service_url); | ^~~~~~~ | setup src/esphome/components/influxdb2/influxdb_writer.cpp:50:19: error: 'class esphome::http_request::HttpRequestComponent' has no member named 'set_method' 50 | this->request_->set_method("POST"); | ^~~~~~~~~~ src/esphome/components/influxdb2/influxdb_writer.cpp: In member function 'void esphome::influxdb::InfluxDBWriter::write(std::string, std::string, std::string, std::string, bool)': src/esphome/components/influxdb2/influxdb_writer.cpp:103:19: error: 'class esphome::http_request::HttpRequestComponent' has no member named 'set_body' 103 | this->request_->set_body(line.c_str()); | ^~~~~~~~ src/esphome/components/influxdb2/influxdb_writer.cpp:104:19: error: 'class esphome::http_request::HttpRequestComponent' has no member named 'send' 104 | this->request_->send({}); | ^~~~ src/esphome/components/influxdb2/influxdb_writer.cpp:105:19: error: 'class esphome::http_request::HttpRequestComponent' has no member named 'close' 105 | this->request_->close();

CalvinSchwartz commented 2 months ago

Solved by 3c6c6c8