15 int32_t
size()
const override {
return 1; }
36 for (
auto cm : color_mode_precedence) {
88 float color_brightness = fmaxf(r, fmaxf(g, b));
89 float brightness = fmaxf(color_brightness, w);
90 if (brightness == 0.0f) {
91 call.set_state(
false);
93 color_brightness /= brightness;
98 call.set_brightness_if_supported(brightness);
99 call.set_color_brightness_if_supported(color_brightness);
100 call.set_red_if_supported(r);
101 call.set_green_if_supported(g);
102 call.set_blue_if_supported(b);
103 call.set_white_if_supported(w);
104 call.set_warm_white_if_supported(w);
105 call.set_cold_white_if_supported(w);
107 call.set_transition_length_if_supported(0);
108 call.set_publish(
false);
109 call.set_save(
false);
118 &this->wrapper_state_[3], &this->wrapper_state_[4], &this->
correction_};
ColorMode
Color modes are a combination of color capabilities that can be used at the same time.
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
bool is_on() const
Get the binary true/false state of these light color values.
light::ESPColorView get_view_internal(int32_t index) const override
float get_gamma_correct() const
RGB color output and a separate white output.
Color temperature can be controlled.
RGB color output, and separate cold and warm white outputs.
AddressableLightWrapper(light::LightState *light_state)
int32_t size() const override
light::LightTraits get_traits() override
Brightness of cold and warm white output can be controlled.
Light can be turned on/off.
void clear_effect_data() override
RGB color output and a separate white output with controllable color temperature. ...
Master brightness of the light can be controlled.
White output only (use only if the light also has another color mode such as RGB).
No color mode configured (cannot be a supported mode, only active when light is off).
This class is used to represent the capabilities of a light.
bool supports_color_mode(ColorMode color_mode) const
ESPColorCorrection correction_
void write_state(light::LightState *state) override
Implementation of SPI Controller mode.
Color can be controlled using RGB format (includes a brightness control for the color).
LightColorValues remote_values
The remote color values reported to the frontend.
light::LightState * light_state_
void set_supported_color_modes(std::set< ColorMode > supported_color_modes)
float gamma_uncorrect(float value, float gamma)
Reverts gamma correction of gamma to value.