ESPHome
2024.10.2
|
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. More... | |
virtual void | start () |
This will be called before the transition is started. More... | |
virtual optional< LightColorValues > | apply ()=0 |
This will be called while the transformer is active to apply the transition to the light. More... | |
virtual void | stop () |
This will be called after transition is finished. More... | |
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. More... | |
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 11 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 42 of file light_transformer.h.
|
inline |
Definition at line 36 of file light_transformer.h.
|
inline |
Definition at line 38 of file light_transformer.h.
|
inlinevirtual |
Indicates whether this transformation is finished.
Reimplemented in esphome::light::LightFlashTransformer.
Definition at line 24 of file light_transformer.h.
|
inline |
Definition at line 15 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 27 of file light_transformer.h.
|
inlinevirtual |
This will be called after transition is finished.
Reimplemented in esphome::light::LightFlashTransformer.
Definition at line 34 of file light_transformer.h.
|
protected |
Definition at line 53 of file light_transformer.h.
|
protected |
Definition at line 52 of file light_transformer.h.
|
protected |
Definition at line 54 of file light_transformer.h.
|
protected |
Definition at line 55 of file light_transformer.h.