ESPHome 2026.10.0
Loading...
Searching...
No Matches
light_state.cpp
Go to the documentation of this file.
1#include "light_state.h"
4#ifdef USE_LIGHT_TRANSITION_PUBLISH_INTERVAL
6#endif
8#include "esphome/core/log.h"
9#include "light_output.h"
10#include "transformers.h"
11
12#include <limits>
13
14namespace esphome::light {
15
16static const char *const TAG = "light";
17
18// Colour modes are bitmasks of capabilities. A mode the light doesn't support may be a bare set of
19// required capabilities (see restore_state.py's colour mode inference): use the first supported
20// mode that provides all of them, or leave it unchanged if there is none.
21static ColorMode resolve_color_mode(const LightTraits &traits, ColorMode requested) {
22 if (requested == ColorMode::UNKNOWN || traits.supports_color_mode(requested))
23 return requested;
24 auto wanted = static_cast<uint8_t>(requested);
25 for (ColorMode mode : traits.get_supported_color_modes()) {
26 if ((static_cast<uint8_t>(mode) & wanted) == wanted)
27 return mode;
28 }
29 return requested;
30}
31
32LightState::LightState(LightOutput *output) : output_(output) {}
33
39
41 this->output_->setup_state(this);
42 for (auto *effect : this->effects_) {
43 effect->init_internal(this);
44 }
45
46 // Start with loop disabled if idle - respects any effects/transitions set up during initialization
48
49 // When supported color temperature range is known, initialize color temperature setting within bounds.
50 auto traits = this->get_traits();
51 float min_mireds = traits.get_min_mireds();
52 if (min_mireds > 0) {
53 this->remote_values.set_color_temperature(min_mireds);
54 this->current_values.set_color_temperature(min_mireds);
55 }
56
57 auto call = this->make_call();
58 LightStateRTCState recovered{};
59 bool restored = false;
60 if (this->save_enabled_) {
62 restored = this->rtc_.load(&recovered);
63 }
64 if (this->state_callback_) {
65 this->state_callback_(recovered, restored);
66 this->state_callback_ = nullptr; // One-shot — no longer needed
67 }
68
69 // A light coming up on boot must never end up on-but-invisible: if the resolved restore
70 // state is on but its brightness is zero (e.g. a stale/persisted value from before a
71 // forced-on restore mode, or an inverted restore flipping a dim-to-0 off state to on),
72 // reset it to full brightness.
73 if (recovered.state && recovered.brightness == 0.0f) {
74 recovered.brightness = 1.0f;
75 }
76
77 call.set_color_mode_if_supported(resolve_color_mode(traits, recovered.color_mode));
78 call.set_state(recovered.state);
79 call.set_brightness_if_supported(recovered.brightness);
80 call.set_color_brightness_if_supported(recovered.color_brightness);
81 call.set_red_if_supported(recovered.red);
82 call.set_green_if_supported(recovered.green);
83 call.set_blue_if_supported(recovered.blue);
84 call.set_white_if_supported(recovered.white);
85 call.set_color_temperature_if_supported(recovered.color_temp);
86 call.set_cold_white_if_supported(recovered.cold_white);
87 call.set_warm_white_if_supported(recovered.warm_white);
88 if (recovered.effect != 0) {
89 call.set_effect(recovered.effect);
90 } else {
91 call.set_transition_length_if_supported(0);
92 }
93 call.perform();
94}
96 ESP_LOGCONFIG(TAG, "Light '%s'", this->get_name().c_str());
97 auto traits = this->get_traits();
98 if (traits.supports_color_capability(ColorCapability::BRIGHTNESS)) {
99#ifdef USE_LIGHT_GAMMA_LUT
100 // Read the stored gamma * 100 directly so dump_config does not pull in get_gamma_correct()
101 const unsigned gamma_x100 =
102 this->gamma_table_ != nullptr ? progmem_read_uint16(&this->gamma_table_->gamma_x100) : 0;
103#else
104 const unsigned gamma_x100 = 0;
105#endif
106 ESP_LOGCONFIG(TAG,
107 " Default Transition Length: %.1fs\n"
108 " Gamma Correct: %u.%02u",
109 this->default_transition_length_ / 1e3f, gamma_x100 / 100, gamma_x100 % 100);
110#ifdef USE_LIGHT_TRANSITION_PUBLISH_INTERVAL
111 // The define is build wide; only lights that set the option have an interval
112 if (this->transition_state_publish_interval_ != 0) {
113 ESP_LOGCONFIG(TAG, " Transition State Publish Interval: %" PRIu32 "ms",
115 }
116#endif
117 }
118 if (traits.supports_color_capability(ColorCapability::COLOR_TEMPERATURE)) {
119 ESP_LOGCONFIG(TAG,
120 " Min Mireds: %.1f\n"
121 " Max Mireds: %.1f",
122 traits.get_min_mireds(), traits.get_max_mireds());
123 }
124}
126 // Apply effect (if any)
127 auto *effect = this->get_active_effect_();
128 if (effect != nullptr) {
129 effect->apply();
130 }
131
132 // Apply transformer (if any)
133 if (this->transformer_ != nullptr) {
134 auto values = this->transformer_->apply();
135 this->is_transformer_active_ = true;
136 if (values.has_value()) {
137 this->current_values = *values;
138 this->output_->update_state(this);
139 this->next_write_ = true;
140 }
141
142 const bool finished = this->transformer_->is_finished();
143#ifdef USE_LIGHT_TRANSITION_PUBLISH_INTERVAL
144 if (this->transition_publish_enabled_ && !finished) {
147 this->publish_state();
149 }
150 }
151#endif
152
153 if (finished) {
154 // if the transition has written directly to the output, current_values is outdated, so update it
155 this->current_values = this->transformer_->get_target_values();
156 this->transformer_->stop();
157 this->is_transformer_active_ = false;
158 this->transformer_ = nullptr;
159#ifdef USE_LIGHT_TRANSITION_PUBLISH_INTERVAL
160 if (this->transition_publish_enabled_) {
161 // Report the end state from remote_values; a flash's stop() left publishing to us
162 this->transition_publish_enabled_ = false;
163 this->publish_state();
164 }
165#endif
167 for (auto *listener : *this->target_state_reached_listeners_) {
168 listener->on_light_target_state_reached();
169 }
170 }
171
172 // Disable loop if idle (no transformer and no effect)
173 this->disable_loop_if_idle_();
174 }
175 }
176
177 // Write state to the light
178 if (this->next_write_) {
179 this->next_write_ = false;
180 this->output_->write_state(this);
181 // Disable loop if idle (no transformer and no effect)
182 this->disable_loop_if_idle_();
183 }
184}
185
187 if (this->remote_values_listeners_) {
188 for (auto *listener : *this->remote_values_listeners_) {
189 listener->on_light_remote_values_update();
190 }
191 }
192#if defined(USE_LIGHT) && defined(USE_CONTROLLER_REGISTRY)
193 ControllerRegistry::notify_light_update(this);
194#endif
195}
196
198
199static constexpr auto EFFECT_NONE_REF = StringRef::from_lit("None");
200
202 if (this->active_effect_index_ > 0) {
203 return this->effects_[this->active_effect_index_ - 1]->get_name();
204 }
205 return EFFECT_NONE_REF;
206}
207
209 if (!this->remote_values_listeners_) {
210 this->remote_values_listeners_ = make_unique<std::vector<LightRemoteValuesListener *>>();
211 }
212 this->remote_values_listeners_->push_back(listener);
213}
216 this->target_state_reached_listeners_ = make_unique<std::vector<LightTargetStateReachedListener *>>();
217 }
218 this->target_state_reached_listeners_->push_back(listener);
219}
220
221void LightState::add_effects(const std::initializer_list<LightEffect *> &effects) {
222 // Called once from Python codegen during setup with all effects from YAML config
223 this->effects_ = effects;
224}
225
227 this->current_values.as_brightness(brightness);
228 *brightness = this->gamma_correct_lut(*brightness);
229}
230void LightState::current_values_as_rgb(float *red, float *green, float *blue) {
231 this->current_values.as_rgb(red, green, blue);
232 *red = this->gamma_correct_lut(*red);
233 *green = this->gamma_correct_lut(*green);
234 *blue = this->gamma_correct_lut(*blue);
235}
236void LightState::current_values_as_rgbw(float *red, float *green, float *blue, float *white) {
237 this->current_values.as_rgbw(red, green, blue, white);
238 *red = this->gamma_correct_lut(*red);
239 *green = this->gamma_correct_lut(*green);
240 *blue = this->gamma_correct_lut(*blue);
241 *white = this->gamma_correct_lut(*white);
242}
243void LightState::current_values_as_rgbww(float *red, float *green, float *blue, float *cold_white, float *warm_white,
244 bool constant_brightness) {
245 this->current_values.as_rgb(red, green, blue);
246 *red = this->gamma_correct_lut(*red);
247 *green = this->gamma_correct_lut(*green);
248 *blue = this->gamma_correct_lut(*blue);
249 this->current_values_as_cwww(cold_white, warm_white, constant_brightness);
250}
251void LightState::current_values_as_rgbct(float *red, float *green, float *blue, float *color_temperature,
252 float *white_brightness) {
253 auto traits = this->get_traits();
254 this->current_values.as_rgbct(traits.get_min_mireds(), traits.get_max_mireds(), red, green, blue, color_temperature,
255 white_brightness);
256 *red = this->gamma_correct_lut(*red);
257 *green = this->gamma_correct_lut(*green);
258 *blue = this->gamma_correct_lut(*blue);
259 *white_brightness = this->gamma_correct_lut(*white_brightness);
260}
261void LightState::current_values_as_cwww(float *cold_white, float *warm_white, bool constant_brightness) {
262 if (!constant_brightness) {
263 // Without constant_brightness, gamma commutes with simple multiplication:
264 // gamma(white_level * cw) = gamma(white_level) * gamma(cw)
265 // (since gamma(a*b) = (a*b)^g = a^g * b^g = gamma(a) * gamma(b))
266 // so applying gamma after is mathematically equivalent and simpler.
267 this->current_values.as_cwww(cold_white, warm_white, false);
268 *cold_white = this->gamma_correct_lut(*cold_white);
269 *warm_white = this->gamma_correct_lut(*warm_white);
270 return;
271 }
272
273 // For constant_brightness mode, gamma MUST be applied to the individual
274 // channel values BEFORE the balancing formula (max/sum ratio), not after.
275 //
276 // Why: The cold_white_ and warm_white_ values stored in LightColorValues
277 // are gamma-uncorrected (see transform_parameters_() which applies
278 // gamma_uncorrect to the linear CW/WW fractions derived from color
279 // temperature). Applying gamma_correct here recovers the original linear
280 // fractions, which the constant_brightness formula then uses to distribute
281 // power evenly. The max/sum formula ensures cold+warm PWM output sums to
282 // a constant, keeping total power (and perceived brightness) the same
283 // across all color temperatures.
284 //
285 // Applying gamma AFTER the formula would be incorrect because gamma is
286 // nonlinear: gamma(a/b) != gamma(a)/gamma(b), so the carefully balanced
287 // ratio would be distorted, causing a severe brightness dip at mid-range
288 // color temperatures.
289 const auto &v = this->current_values;
290 if (!(v.get_color_mode() & ColorCapability::COLD_WARM_WHITE)) {
291 *cold_white = *warm_white = 0;
292 return;
293 }
294
295 const float cw_level = this->gamma_correct_lut(v.get_cold_white());
296 const float ww_level = this->gamma_correct_lut(v.get_warm_white());
297 const float white_level = this->gamma_correct_lut(v.get_state() * v.get_brightness());
298 const float sum = cw_level > 0 || ww_level > 0 ? cw_level + ww_level : 1; // Don't divide by zero.
299 *cold_white = white_level * std::max(cw_level, ww_level) * cw_level / sum;
300 *warm_white = white_level * std::max(cw_level, ww_level) * ww_level / sum;
301}
302void LightState::current_values_as_ct(float *color_temperature, float *white_brightness) {
303 auto traits = this->get_traits();
304 this->current_values.as_ct(traits.get_min_mireds(), traits.get_max_mireds(), color_temperature, white_brightness);
305 *white_brightness = this->gamma_correct_lut(*white_brightness);
306}
307
309#ifdef USE_LIGHT_GAMMA_LUT
310 if (this->gamma_table_ != nullptr)
311 return progmem_read_uint16(&this->gamma_table_->gamma_x100) * 0.01f;
312#endif // USE_LIGHT_GAMMA_LUT
313 return 0.0f;
314}
315
316#ifdef USE_LIGHT_GAMMA_LUT
317float LightState::gamma_correct_lut(float value) const {
318 if (value <= 0.0f)
319 return 0.0f;
320 if (value >= 1.0f)
321 return 1.0f;
322 if (this->gamma_table_ == nullptr)
323 return value;
324 float scaled = value * 255.0f;
325 auto idx = static_cast<uint8_t>(scaled);
326 if (idx >= 255)
327 return progmem_read_uint16(&this->gamma_table_->lut[255]) / 65535.0f;
328 float frac = scaled - idx;
329 float a = progmem_read_uint16(&this->gamma_table_->lut[idx]);
330 float b = progmem_read_uint16(&this->gamma_table_->lut[idx + 1]);
331 return (a + frac * (b - a)) / 65535.0f;
332}
333float LightState::gamma_uncorrect_lut(float value) const {
334 if (value <= 0.0f)
335 return 0.0f;
336 if (value >= 1.0f)
337 return 1.0f;
338 if (this->gamma_table_ == nullptr)
339 return value;
340 uint16_t target = static_cast<uint16_t>(value * 65535.0f);
341 uint8_t lo = gamma_table_reverse_search(this->gamma_table_->lut, target);
342 if (lo >= 255)
343 return 1.0f;
344 // Interpolate between lo and lo+1
345 uint16_t a = progmem_read_uint16(&this->gamma_table_->lut[lo]);
346 uint16_t b = progmem_read_uint16(&this->gamma_table_->lut[lo + 1]);
347 if (b == a)
348 return lo / 255.0f;
349 float frac = static_cast<float>(target - a) / static_cast<float>(b - a);
350 return (lo + frac) / 255.0f;
351}
352#endif // USE_LIGHT_GAMMA_LUT
353
355 // An external add_effects() can exceed the codegen cap; ignore an index the uint16_t can't hold
356 if (effect_index > std::numeric_limits<uint16_t>::max())
357 return;
358 this->stop_effect_();
359 if (effect_index == 0)
360 return;
361
362 this->active_effect_index_ = static_cast<uint16_t>(effect_index);
363 auto *effect = this->get_active_effect_();
364 effect->start_internal();
365 // Enable loop while effect is active
366 this->enable_loop();
367}
369 if (this->active_effect_index_ == 0) {
370 return nullptr;
371 } else {
372 return this->effects_[this->active_effect_index_ - 1];
373 }
374}
376 auto *effect = this->get_active_effect_();
377 if (effect != nullptr) {
378 effect->stop();
379 }
380 this->active_effect_index_ = 0;
381 // Disable loop if idle (no effect and no transformer)
382 this->disable_loop_if_idle_();
383}
384
385void LightState::start_transition_(const LightColorValues &target, uint32_t length, bool set_remote_values) {
387 this->transformer_->setup(this->current_values, target, length);
388 this->set_transformer_remote_values_(target, set_remote_values);
389 // Enable loop while transition is active
390 this->enable_loop();
391}
392
393void LightState::start_flash_(const LightColorValues &target, uint32_t length, bool set_remote_values) {
394 LightColorValues end_colors = this->remote_values;
395 // If starting a flash if one is already happening, set end values to end values of current flash
396 // Hacky but works
397 if (this->transformer_ != nullptr)
398 end_colors = this->transformer_->get_start_values();
399
400 this->transformer_ = make_unique<LightFlashTransformer>(*this);
401 this->transformer_->setup(end_colors, target, length);
402 this->set_transformer_remote_values_(target, set_remote_values);
403 // Enable loop while flash is active
404 this->enable_loop();
405}
406
407void LightState::set_immediately_(const LightColorValues &target, bool set_remote_values) {
408 this->is_transformer_active_ = false;
409 this->transformer_ = nullptr;
410#ifdef USE_LIGHT_TRANSITION_PUBLISH_INTERVAL
411 this->transition_publish_enabled_ = false;
412#endif
413 this->current_values = target;
414 if (set_remote_values) {
415 this->remote_values = target;
416 }
417 this->output_->update_state(this);
418 this->schedule_write_();
419}
420
422 // Only disable loop if both transformer and effect are inactive, and no pending writes
423 if (this->transformer_ == nullptr && this->get_active_effect_() == nullptr && !this->next_write_) {
424 this->disable_loop();
425 }
426}
427
428#ifdef USE_LIGHT_TRANSITION_PUBLISH_INTERVAL
429void LightState::set_transformer_remote_values_(const LightColorValues &target, bool set_remote_values) {
430 this->transition_publish_enabled_ = set_remote_values && this->transition_state_publish_interval_ > 0;
431 if (this->transition_publish_enabled_) {
433 }
434 if (set_remote_values) {
435 this->remote_values = target;
436 }
437}
438#endif
439
441 if (!this->save_enabled_)
442 return;
443 LightStateRTCState saved;
445 // Always the real on/off status (RESTORE_AND_ON/OFF used to persist a hardcoded
446 // true/false here instead; harmless, since those modes force `state` again on
447 // every load regardless of what was saved -- see _legacy_restore_statements).
448 saved.state = this->remote_values.is_on();
451 saved.red = this->remote_values.get_red();
452 saved.green = this->remote_values.get_green();
453 saved.blue = this->remote_values.get_blue();
454 saved.white = this->remote_values.get_white();
458 saved.effect = static_cast<uint32_t>(this->active_effect_index_); // the saved layout stays uint32_t
459 this->rtc_.save(&saved);
460}
461
462} // namespace esphome::light
BedjetMode mode
BedJet operating mode.
uint32_t IRAM_ATTR HOT get_loop_component_start_time() const
Get the cached time in milliseconds from when the current component started its loop execution.
void enable_loop()
Enable this component's loop.
Definition component.h:246
void disable_loop()
Disable this component's loop.
const StringRef & get_name() const
Definition entity_base.h:71
ESPPreferenceObject make_entity_preference(uint32_t version=0)
Create a preference object for storing this entity's state/settings.
StringRef is a reference to a string owned by something else.
Definition string_ref.h:30
static constexpr StringRef from_lit(const CharT(&s)[N])
Definition string_ref.h:54
This class represents a requested change in a light state.
Definition light_call.h:22
LightCall & set_state(optional< bool > state)
Set the binary ON/OFF state of the light.
This class represents the color state for a light object.
float get_brightness() const
Get the brightness property of these light color values. In range 0.0 to 1.0.
float get_blue() const
Get the blue property of these light color values. In range 0.0 to 1.0.
float get_white() const
Get the white property of these light color values. In range 0.0 to 1.0.
float get_color_temperature() const
Get the color temperature property of these light color values in mired.
void as_cwww(float *cold_white, float *warm_white, bool constant_brightness=false) const
Convert these light color values to an CWWW representation with the given parameters.
float get_cold_white() const
Get the cold white property of these light color values. In range 0.0 to 1.0.
void as_rgbw(float *red, float *green, float *blue, float *white) const
Convert these light color values to an RGBW representation and write them to red, green,...
void as_rgb(float *red, float *green, float *blue) const
Convert these light color values to an RGB representation and write them to red, green,...
bool is_on() const
Get the binary true/false state of these light color values.
float get_green() const
Get the green property of these light color values. In range 0.0 to 1.0.
void set_color_temperature(float color_temperature)
Set the color temperature property of these light color values in mired.
float get_warm_white() const
Get the warm white property of these light color values. In range 0.0 to 1.0.
void as_ct(float color_temperature_cw, float color_temperature_ww, float *color_temperature, float *white_brightness) const
Convert these light color values to a CT+BR representation with the given parameters.
ColorMode get_color_mode() const
Get the color mode of these light color values.
void as_rgbct(float color_temperature_cw, float color_temperature_ww, float *red, float *green, float *blue, float *color_temperature, float *white_brightness) const
Convert these light color values to an RGB+CT+BR representation with the given parameters.
float get_red() const
Get the red property of these light color values. In range 0.0 to 1.0.
void as_brightness(float *brightness) const
Convert these light color values to a brightness-only representation and write them to brightness.
float get_color_brightness() const
Get the color brightness property of these light color values. In range 0.0 to 1.0.
Interface to write LightStates to hardware.
virtual void write_state(LightState *state)=0
Called from loop() every time the light state has changed, and should should write the new state to h...
virtual std::unique_ptr< LightTransformer > create_default_transition()
Return the default transformer used for transitions.
virtual LightTraits get_traits()=0
Return the LightTraits of this LightOutput.
virtual void update_state(LightState *state)
Called on every update of the current values of the associated LightState, can optionally be used to ...
virtual void setup_state(LightState *state)
Listener interface for light remote value changes.
Definition light_state.h:32
void add_remote_values_listener(LightRemoteValuesListener *listener)
Add a listener for remote values changes.
FixedVector< LightEffect * > effects_
List of effects for this light.
StringRef get_effect_name()
Return the name of the current effect, or if no effect is active "None".
void start_effect_(uint32_t effect_index)
Internal method to start an effect with the given index.
void current_values_as_rgb(float *red, float *green, float *blue)
float gamma_correct_lut(float value) const
Apply gamma correction using the pre-computed forward LUT.
void stop_effect_()
Internal method to stop the current effect (if one is active).
void current_values_as_rgbct(float *red, float *green, float *blue, float *color_temperature, float *white_brightness)
void disable_loop_if_idle_()
Disable loop if neither transformer nor effect is active.
std::unique_ptr< LightTransformer > transformer_
The currently active transformer for this light (transition/flash).
void dump_config() override
bool transition_publish_enabled_
True while the active transformer publishes current_values on an interval from loop().
LightColorValues remote_values
The remote color values reported to the frontend.
LightOutput * get_output() const
Get the light output associated with this object.
void(* state_callback_)(LightStateRTCState &, bool restored)
Callback that resolves the boot-time state — called once during setup, then cleared.
LightState(LightOutput *output)
void save_remote_values_()
Internal method to save the current remote_values to the preferences.
void add_target_state_reached_listener(LightTargetStateReachedListener *listener)
Add a listener for target state reached.
LightCall turn_on()
Make a light state call.
void set_immediately_(const LightColorValues &target, bool set_remote_values)
Internal method to set the color values to target immediately (with no transition).
float get_gamma_correct() const
The gamma correction factor, read from the entry after the gamma lookup table; 0 without one.
void current_values_as_ct(float *color_temperature, float *white_brightness)
float gamma_uncorrect_lut(float value) const
Reverse gamma correction by binary-searching the forward LUT.
void current_values_as_cwww(float *cold_white, float *warm_white, bool constant_brightness=false)
void publish_state()
Publish the currently active state to the frontend.
void current_values_as_rgbww(float *red, float *green, float *blue, float *cold_white, float *warm_white, bool constant_brightness=false)
void current_values_as_brightness(float *brightness)
void setup() override
Load state from preferences.
const GammaTable * gamma_table_
void start_flash_(const LightColorValues &target, uint32_t length, bool set_remote_values)
Internal method to start a flash for the specified amount of time.
uint32_t transition_state_publish_interval_
void add_effects(const std::initializer_list< LightEffect * > &effects)
Add effects for this light state.
void schedule_write_()
Schedule a write to the light output and enable the loop to process it.
bool next_write_
Whether the light value should be written in the next cycle.
void start_transition_(const LightColorValues &target, uint32_t length, bool set_remote_values)
Internal method to start a transition to the target color with the given length.
bool save_enabled_
Whether this light persists its state to preferences at all.
LightOutput * output_
Store the output to allow effects to have more access.
ESPPreferenceObject rtc_
Object used to store the persisted values of the light.
uint16_t active_effect_index_
1-based index of the active effect, 0 if none; codegen caps effects at MAX_EFFECTS in effects....
void current_values_as_rgbw(float *red, float *green, float *blue, float *white)
uint32_t default_transition_length_
Default transition length for all transitions in ms.
LightColorValues current_values
The current values of the light as outputted to the light.
LightEffect * get_active_effect_()
Internal method to get the currently active effect.
std::unique_ptr< std::vector< LightRemoteValuesListener * > > remote_values_listeners_
Listeners for remote values changes.
std::unique_ptr< std::vector< LightTargetStateReachedListener * > > target_state_reached_listeners_
Listeners for target state reached.
uint32_t last_transition_state_publish_
void set_transformer_remote_values_(const LightColorValues &target, bool set_remote_values)
Point remote_values at the new transformer's target and, when this light publishes intermediate state...
Listener interface for light target state reached.
Definition light_state.h:43
This class is used to represent the capabilities of a light.
Definition light_traits.h:9
uint8_t gamma_table_reverse_search(const uint16_t *table, uint16_t target)
Binary search a monotonically increasing uint16[256] PROGMEM table.
static float float b
ColorMode
Color modes are a combination of color capabilities that can be used at the same time.
Definition color_mode.h:49
@ UNKNOWN
No color mode configured (cannot be a supported mode, only active when light is off).
@ BRIGHTNESS
Master brightness of the light can be controlled.
@ COLOR_TEMPERATURE
Color temperature can be controlled.
@ COLD_WARM_WHITE
Brightness of cold and warm white output can be controlled.
uint16_t progmem_read_uint16(const uint16_t *addr)
Definition hal.h:45
Application App
Global storage of Application pointer - only one Application can exist.
uint16_t length
Definition tt21100.cpp:0