Hi,
In these two issues (links at the end of the message), OttoWinter ask to use the new light.dim_relative
. Then I would like to know if it’s possible to use it expressed in lambdas?
For example for light.turn_on
it’s possible to use it this way:
auto call = id(light_1).turn_on();
// set parameters (optional)
call.set_transition_length(1000); // in ms
call.set_brightness(1.0); // 1.0 is full brightness
call.set_rgb(1.0, 1.0, 1.0); // color, 1.0 is fully lit
call.set_effect("The Effect");
// perform action:
call.perform();
Then I would like to do something like that:
auto call = id(led_strip).dim_relative();
call.set_relative_brightness(-0.5);
call.perform();
But this exact code give the following error:
...
Compiling /data/sous_sol_led/.pioenvs/sous_sol_led/src/main.cpp.o
src/main.cpp: In lambda function:
src/main.cpp:278:30: error: 'class esphome::light::LightState' has no member named 'dim_relative'
auto call = led_strip->dim_relative();
^
*** [/data/sous_sol_led/.pioenvs/sous_sol_led/src/main.cpp.o] Error 1
Thanks,
Christophe
https://github.com/esphome/issues/issues/347
https://github.com/esphome/feature-requests/issues/185