hugokernel / esphome-water-meter

Measurement of water consumption directly from your water meter with a TCRT5000 like sensor and ESPHome.
MIT License
63 stars 9 forks source link

Compilation error with ESPHome version 2024.5.4 #12

Open mhaket opened 1 month ago

mhaket commented 1 month ago

When I compile the 'watermeter.yaml' file in the latest version of ESPHome (version 2024.5.4) I get the following error message:

Compiling .pioenvs/watermeter/lib67b/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o
/config/esphome/watermeter.yaml: In lambda function:
/config/esphome/watermeter.yaml:322:63: error: 'api_apiserver' was not declared in this scope; did you mean 'api_apiserver_id'?
  322 |                   api = new api::HomeAssistantServiceCallAction<>(api_apiserver, true);
      |                                                               ^~~~~~~~~~~~~
      |                                                               api_apiserver_id
*** [.pioenvs/watermeter/src/main.cpp.o] Error 1

When I replace:

api = new api::HomeAssistantServiceCallAction<>(api_apiserver, true);

by

api = new api::HomeAssistantServiceCallAction<>(api_apiserver_id, true);

everything compiles again without issues.

hugokernel commented 1 month ago

Hi, Thank you, I will look at this fix soon. ++