ESPHome 2025.10.0-dev
Loading...
Searching...
No Matches
esphome::light::RandomLightEffect Class Reference

Random effect. Sets random colors every 10 seconds and slowly transitions between them. More...

#include <base_light_effects.h>

Inheritance diagram for esphome::light::RandomLightEffect:
esphome::light::LightEffect

Public Member Functions

 RandomLightEffect (const std::string &name)
 
void apply () override
 
void set_transition_length (uint32_t transition_length)
 
void set_update_interval (uint32_t update_interval)
 
- Public Member Functions inherited from esphome::light::LightEffect
 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.
 
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.
 
LightStateget_light_state () const
 Get a reference to the parent light state.
 

Protected Attributes

uint32_t last_color_change_ {0}
 
uint32_t transition_length_ {}
 
uint32_t update_interval_ {}
 
- Protected Attributes inherited from esphome::light::LightEffect
LightStatestate_ {nullptr}
 
std::string name_
 

Additional Inherited Members

- Protected Member Functions inherited from esphome::light::LightEffect
uint32_t get_index_in_parent_ () const
 Internal method to find this effect's index in the parent light's effect list.
 

Detailed Description

Random effect. Sets random colors every 10 seconds and slowly transitions between them.

Definition at line 61 of file base_light_effects.h.

Constructor & Destructor Documentation

◆ RandomLightEffect()

esphome::light::RandomLightEffect::RandomLightEffect ( const std::string & name)
inlineexplicit

Definition at line 63 of file base_light_effects.h.

Member Function Documentation

◆ apply()

void esphome::light::RandomLightEffect::apply ( )
inlineoverridevirtual

Implements esphome::light::LightEffect.

Definition at line 65 of file base_light_effects.h.

◆ set_transition_length()

void esphome::light::RandomLightEffect::set_transition_length ( uint32_t transition_length)
inline

Definition at line 103 of file base_light_effects.h.

◆ set_update_interval()

void esphome::light::RandomLightEffect::set_update_interval ( uint32_t update_interval)
inline

Definition at line 105 of file base_light_effects.h.

Field Documentation

◆ last_color_change_

uint32_t esphome::light::RandomLightEffect::last_color_change_ {0}
protected

Definition at line 108 of file base_light_effects.h.

◆ transition_length_

uint32_t esphome::light::RandomLightEffect::transition_length_ {}
protected

Definition at line 109 of file base_light_effects.h.

◆ update_interval_

uint32_t esphome::light::RandomLightEffect::update_interval_ {}
protected

Definition at line 110 of file base_light_effects.h.


The documentation for this class was generated from the following file: