ESPHome 2025.9.0
|
#include <light_effect.h>
Public Member Functions | |
LightEffect (std::string name) | |
virtual void | start () |
Initialize this LightEffect. Will be called once after creation. | |
virtual void | start_internal () |
virtual void | stop () |
Called when this effect is about to be removed. | |
virtual void | apply ()=0 |
Apply this effect. Use the provided state for starting transitions, ... | |
const std::string & | get_name () |
virtual void | init () |
Internal method called by the LightState when this light effect is registered in it. | |
void | init_internal (LightState *state) |
uint32_t | get_index () const |
Get the index of this effect in the parent light's effect list. | |
bool | is_active () const |
Check if this effect is currently active. | |
LightState * | get_light_state () const |
Get a reference to the parent light state. | |
Protected Member Functions | |
uint32_t | get_index_in_parent_ () const |
Internal method to find this effect's index in the parent light's effect list. | |
Protected Attributes | |
LightState * | state_ {nullptr} |
std::string | name_ |
Definition at line 12 of file light_effect.h.
|
inlineexplicit |
Definition at line 14 of file light_effect.h.
|
pure virtual |
Apply this effect. Use the provided state for starting transitions, ...
Implemented in esphome::light::AddressableLightEffect, esphome::light::AutomationLightEffect, esphome::light::FlickerLightEffect, esphome::light::LambdaLightEffect, esphome::light::PulseLightEffect, esphome::light::RandomLightEffect, and esphome::light::StrobeLightEffect.
uint32_t esphome::light::LightEffect::get_index | ( | ) | const |
Get the index of this effect in the parent light's effect list.
Returns 0 if not found or not initialized.
Definition at line 7 of file light_effect.cpp.
|
protected |
Internal method to find this effect's index in the parent light's effect list.
Definition at line 21 of file light_effect.cpp.
|
inline |
Get a reference to the parent light state.
Returns nullptr if not initialized.
Definition at line 46 of file light_effect.h.
|
inline |
Definition at line 27 of file light_effect.h.
|
inlinevirtual |
Internal method called by the LightState when this light effect is registered in it.
Definition at line 30 of file light_effect.h.
|
inline |
Definition at line 32 of file light_effect.h.
bool esphome::light::LightEffect::is_active | ( | ) | const |
Check if this effect is currently active.
Definition at line 14 of file light_effect.cpp.
|
inlinevirtual |
Initialize this LightEffect. Will be called once after creation.
Reimplemented in esphome::adalight::AdalightLightEffect, esphome::e131::E131AddressableLightEffect, esphome::light::AddressableFireworksEffect, esphome::light::AddressableLambdaLightEffect, esphome::light::LambdaLightEffect, and esphome::wled::WLEDLightEffect.
Definition at line 17 of file light_effect.h.
|
inlinevirtual |
Reimplemented in esphome::light::AddressableLightEffect.
Definition at line 19 of file light_effect.h.
|
inlinevirtual |
Called when this effect is about to be removed.
Reimplemented in esphome::adalight::AdalightLightEffect, esphome::e131::E131AddressableLightEffect, esphome::light::AddressableLightEffect, esphome::light::AutomationLightEffect, and esphome::wled::WLEDLightEffect.
Definition at line 22 of file light_effect.h.
|
protected |
Definition at line 50 of file light_effect.h.
|
protected |
Definition at line 49 of file light_effect.h.