Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in lambda function when compiling firmware #2

Open
SirSeko opened this issue Jan 17, 2025 · 0 comments
Open

Error in lambda function when compiling firmware #2

SirSeko opened this issue Jan 17, 2025 · 0 comments

Comments

@SirSeko
Copy link

SirSeko commented Jan 17, 2025

What is the issue?

When compiling nobo.yaml with esphome, following error occurs in lambda function:
...
/config/esphome/esphome-web-e03626.yaml: In lambda function:
/config/esphome/esphome-web-e03626.yaml:91:41: error: 'class esphome::nobo::NoboClimate' has no member named 'get_heater_power_percentage'; did you mean 'float esphome::nobo::NoboClimate::heater_power_percentage_'? (not accessible from this context)
91 | float current_power = id(noboheater).get_heater_power_percentage();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/esphome.h:55,
from src/main.cpp:3:
src/esphome/components/nobo/nobo.h:37:10: note: declared protected here
37 | float heater_power_percentage_;
| ^~~~~~~~~~~~~~~~~~~~~~~~
Compiling .pioenvs/nobo/lib67b/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o
Compiling .pioenvs/nobo/lib67b/ESP8266WiFi/WiFiUdp.cpp.o
Compiling .pioenvs/nobo/lib67b/ESP8266WiFi/enable_wifi_at_boot_time.cpp.o
*** [.pioenvs/nobo/src/main.cpp.o] Error 1
========================== [FAILED] Took 9.76 seconds ==========================

Workaround / Fix:
Fixed error by adding public getter to following line in nobo.h file:

class NoboClimate : public climate::Climate, public Component, public i2c::I2CDevice {
public:
// ... existing public methods ...

// Add this new public getter method
float get_heater_power_percentage() const { return heater_power_percentage_; }

// ... rest of the class definition remains the same
};

} // namespace nobo
} // namespace esphome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant