|
ESPHome 2026.1.0-dev
|
Base class for all light color transformers, such as transitions or flashes. More...
#include <light_transformer.h>
Public Member Functions | |
| virtual | ~LightTransformer ()=default |
| void | setup (const LightColorValues &start_values, const LightColorValues &target_values, uint32_t length) |
| virtual bool | is_finished () |
| Indicates whether this transformation is finished. | |
| virtual void | start () |
| This will be called before the transition is started. | |
| virtual optional< LightColorValues > | apply ()=0 |
| This will be called while the transformer is active to apply the transition to the light. | |
| virtual void | stop () |
| This will be called after transition is finished. | |
| const LightColorValues & | get_start_values () const |
| const LightColorValues & | get_target_values () const |
Protected Member Functions | |
| float | get_progress_ () |
| The progress of this transition, on a scale of 0 to 1. | |
Static Protected Member Functions | |
| static float | smoothed_progress (float x) |
Protected Attributes | |
| uint32_t | start_time_ |
| uint32_t | length_ |
| LightColorValues | start_values_ |
| LightColorValues | target_values_ |
Base class for all light color transformers, such as transitions or flashes.
Definition at line 10 of file light_transformer.h.
|
virtualdefault |
|
pure virtual |
This will be called while the transformer is active to apply the transition to the light.
Can either write to the light directly, or return LightColorValues that will be applied.
Implemented in esphome::light::AddressableLightTransformer, esphome::light::LightFlashTransformer, and esphome::light::LightTransitionTransformer.
|
inlineprotected |
The progress of this transition, on a scale of 0 to 1.
Definition at line 45 of file light_transformer.h.
|
inline |
Definition at line 35 of file light_transformer.h.
|
inline |
Definition at line 37 of file light_transformer.h.
|
inlinevirtual |
Indicates whether this transformation is finished.
Reimplemented in esphome::light::LightFlashTransformer.
Definition at line 23 of file light_transformer.h.
|
inline |
Definition at line 14 of file light_transformer.h.
Definition at line 42 of file light_transformer.h.
|
inlinevirtual |
This will be called before the transition is started.
Reimplemented in esphome::light::AddressableLightTransformer, esphome::light::LightFlashTransformer, and esphome::light::LightTransitionTransformer.
Definition at line 26 of file light_transformer.h.
|
inlinevirtual |
This will be called after transition is finished.
Reimplemented in esphome::light::LightFlashTransformer.
Definition at line 33 of file light_transformer.h.
|
protected |
Definition at line 56 of file light_transformer.h.
|
protected |
Definition at line 55 of file light_transformer.h.
|
protected |
Definition at line 57 of file light_transformer.h.
|
protected |
Definition at line 58 of file light_transformer.h.