ESPHome 2025.5.0
Loading...
Searching...
No Matches
monochromatic_light_output.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace monochromatic {
9
11 public:
12 void set_output(output::FloatOutput *output) { output_ = output; }
14 auto traits = light::LightTraits();
15 traits.set_supported_color_modes({light::ColorMode::BRIGHTNESS});
16 return traits;
17 }
19 float bright;
20 state->current_values_as_brightness(&bright);
21 this->output_->set_level(bright);
22 }
23
24 protected:
26};
27
28} // namespace monochromatic
29} // namespace esphome
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:63
This class is used to represent the capabilities of a light.
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:0
@ BRIGHTNESS
Dimmable light.
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7