34 : color_mode(color_mode),
36 brightness(brightness),
37 color_brightness(color_brightness),
42 color_temp(color_temp),
43 cold_white(cold_white),
44 warm_white(warm_white) {}
78 void setup()
override;
79 void dump_config()
override;
82 float get_setup_priority()
const override;
109 void publish_state();
115 std::string get_effect_name();
123 void add_new_remote_values_callback(std::function<
void()> &&send_callback);
131 void add_new_target_state_reached_callback(std::function<
void()> &&send_callback);
134 void set_default_transition_length(uint32_t default_transition_length);
135 uint32_t get_default_transition_length()
const;
138 void set_flash_transition_length(uint32_t flash_transition_length);
139 uint32_t get_flash_transition_length()
const;
152 bool supports_effects();
155 const std::vector<LightEffect *> &get_effects()
const;
158 void add_effects(
const std::vector<LightEffect *> &effects);
161 void current_values_as_binary(
bool *binary);
163 void current_values_as_brightness(
float *
brightness);
165 void current_values_as_rgb(
float *
red,
float *
green,
float *
blue,
bool color_interlock =
false);
167 void current_values_as_rgbw(
float *red,
float *green,
float *blue,
float *
white,
bool color_interlock =
false);
169 void current_values_as_rgbww(
float *red,
float *green,
float *blue,
float *
cold_white,
float *
warm_white,
170 bool constant_brightness =
false);
172 void current_values_as_rgbct(
float *red,
float *green,
float *blue,
float *color_temperature,
173 float *white_brightness);
175 void current_values_as_cwww(
float *cold_white,
float *warm_white,
bool constant_brightness =
false);
177 void current_values_as_ct(
float *color_temperature,
float *white_brightness);
188 bool is_transformer_active();
196 void start_effect_(uint32_t effect_index);
208 void set_immediately_(
const LightColorValues &target,
bool set_remote_values);
211 void save_remote_values_();
216 uint32_t active_effect_index_{};
218 std::unique_ptr<LightTransformer> transformer_{
nullptr};
220 bool next_write_{
true};
240 uint32_t default_transition_length_{};
242 uint32_t flash_transition_length_{};
244 float gamma_correct_{};
253 bool is_transformer_active_ =
false;
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...
ESPPreferenceObject rtc_
Object used to store the persisted values of the light.
Interface to write LightStates to hardware.
LightColorValues current_values
The current values of the light as outputted to the light.
float get_gamma_correct() const
LightRestoreMode restore_mode_
Restore mode of the light.
LightStateRTCState()=default
LightOutput * output_
Store the output to allow effects to have more access.
float gamma_correct(float value, float gamma)
Applies gamma correction of gamma to value.
This class represents the color state for a light object.
This class represents a requested change in a light state.
std::vector< LightEffect * > effects_
List of effects for this light.
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.
Implementation of SPI Controller mode.
LightColorValues remote_values
The remote color values reported to the frontend.
LightStateRTCState(ColorMode color_mode, bool state, float brightness, float color_brightness, float red, float green, float blue, float white, float color_temp, float cold_white, float warm_white)