I’m trying to display the brightness of a
light: on my OLED display. However, I have having trouble finding how to pull that info. I’ve searched the docs and forums but not seeing it anywhere.
I’ve tried the following code, but no matter what I guess at it doesn’t compile. I’ve tried id(lamp).state, .value, .brightness, .get_brightness, etc.
light: - platform: monochromatic id: lamp name: "Lamp" output: lamp_driver gamma_correct: 5 output: - platform: ledc id: lamp_driver pin: GPIO32 frequency: 1000Hz display: - platform: ssd1306_i2c id: oled model: "SSD1306 128x64" address: 0x3C lambda: |- it.printf(0, 0, id(font_status), TextAlign::TOP_LEFT, "%.1%%", id(lamp).state;
I get the following compile error:
src/main.cpp:590:72: error: 'class esphome::light::LightState' has no member named 'state' it.printf(0, 0, font_status, TextAlign::TOP_LEFT, "%.1%%", lamp->state);
Any pointers would be appreciated!