Hi all,
I’m trying like since a couple of hours to use a secret variable inside a lambda.
Somehow, it looks like, it’s not possible directly.
So I’ve created a global variable of type string like this:
my_variable is defined as"123fadk99kjdfa789" in secrets.yaml.
And then in the lambda, I’ve tried “almost” everything similar to:
std::string test = id(emoncms_api_key);
I get this error:
/config/esphome/linky-huzzah-esp8266.yaml: In function 'void setup()':
/config/esphome/linky-huzzah-esp8266.yaml:95:64: error: unable to find numeric literal operator 'operator""fadk99kjdfa789'
95 | url: !lambda |-
| ^
*** [.pioenvs/linky-huzzah-esp8266/src/main.cpp.o] Error 1
As you can see, all numbers from the beginning of the variable are removed, then the rest is correct !!
What’s going on ?!? I don’t understand it all !
Well, I’ve just removed everything from the lambda, I still get the strange error.
So, it looks like the initialization of the global variable is buggy.
Even the doc says the initial_value is a string, it’s getting somehow interpreted/converted/… and the any starting number leads to this strange behavior.