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_};
ESPColorCorrection correction_
void write_state(light::LightState *state) override
int32_t size() const override
light::ESPColorView get_view_internal(int32_t index) const override
light::LightState * light_state_
void clear_effect_data() override
AddressableLightWrapper(light::LightState *light_state)
light::LightTraits get_traits() override
bool is_on() const
Get the binary true/false state of these light color values.
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
LightColorValues remote_values
The remote color values reported to the frontend.
float get_gamma_correct() const
This class is used to represent the capabilities of a light.
bool supports_color_mode(ColorMode color_mode) const
void set_supported_color_modes(std::set< ColorMode > supported_color_modes)
ColorMode
Color modes are a combination of color capabilities that can be used at the same time.
@ ON_OFF
Only on/off control.
@ RGB_COLD_WARM_WHITE
RGB color output, and separate cold and warm white outputs.
@ BRIGHTNESS
Dimmable light.
@ UNKNOWN
No color mode configured (cannot be a supported mode, only active when light is off).
@ RGB_WHITE
RGB color output and a separate white output.
@ RGB_COLOR_TEMPERATURE
RGB color output and a separate white output with controllable color temperature.
@ COLOR_TEMPERATURE
Controllable color temperature output.
@ WHITE
White output only (use only if the light also has another color mode such as RGB).
@ COLD_WARM_WHITE
Cold and warm white output with individually controllable brightness.
Providing packet encoding functions for exchanging data with a remote host.
float gamma_uncorrect(float value, float gamma)
Reverts gamma correction of gamma to value.