ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
monochromatic_light_output.h
Go to the documentation of this file.
1#pragma once
2
6
8
10 public:
11 void set_output(output::FloatOutput *output) { output_ = output; }
13 auto traits = light::LightTraits();
14 traits.set_supported_color_modes({light::ColorMode::BRIGHTNESS});
15 return traits;
16 }
18 float bright;
19 state->current_values_as_brightness(&bright);
20 this->output_->set_level(bright);
21 }
22
23 protected:
25};
26
27} // namespace esphome::monochromatic
Interface to write LightStates to hardware.
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
Definition light_state.h:93
This class is used to represent the capabilities of a light.
Definition light_traits.h:9
void write_state(light::LightState *state) override
Base class for all output components that can output a variable level, like PWM.
void set_level(float state)
Set the level of this float output, this is called from the front-end.
bool state
Definition fan.h:2
@ BRIGHTNESS
Dimmable light.