The documentation on addressable_light as a display says that it should be possible to call set_enabled(false)
to disable the display and allow using it as a light instead.
I’m getting the following error message:
<unicode string>:95:12: error: 'class esphome::display::Display' has no member named 'set_enabled'; did you mean 'set_pages'?
for the following lambda:
if (id(display_switch).state) {
it.set_enabled(true);
// Draw a bulls-eye pattern
Color red = Color(0xFF0000);
Color green = Color(0x00FF00);
Color blue = Color(0x0000FF);
it.rectangle(0, 0, 16, 16, red);
it.rectangle(1, 1, 14, 14, red);
it.rectangle(2, 2, 12, 12, green);
it.rectangle(3, 3, 10, 10, green);
it.rectangle(4, 4, 8, 8, blue);
it.rectangle(5, 5, 6, 6, blue);
it.rectangle(6, 6, 4, 4, red);
it.rectangle(7, 7, 2, 2, red);
} else {
it.set_enabled(false);
}
I’m assuming that I need to cast the it
variable somehow, but that’s the limit of my C++ skills. Has anyone used that successfully?