ESPHome  2024.4.1
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
esphome::adalight::AdalightLightEffect Class Reference

#include <adalight_light_effect.h>

Inheritance diagram for esphome::adalight::AdalightLightEffect:
esphome::light::AddressableLightEffect esphome::uart::UARTDevice esphome::light::LightEffect

Public Member Functions

 AdalightLightEffect (const std::string &name)
 
void start () override
 
void stop () override
 
void apply (light::AddressableLight &it, const Color &current_color) override
 
- Public Member Functions inherited from esphome::light::AddressableLightEffect
 AddressableLightEffect (const std::string &name)
 
void start_internal () override
 
void stop () override
 
void apply () override
 
- Public Member Functions inherited from esphome::light::LightEffect
 LightEffect (std::string name)
 
const std::string & get_name ()
 
virtual void init ()
 Internal method called by the LightState when this light effect is registered in it. More...
 
void init_internal (LightState *state)
 
- Public Member Functions inherited from esphome::uart::UARTDevice
 UARTDevice ()=default
 
 UARTDevice (UARTComponent *parent)
 
void set_uart_parent (UARTComponent *parent)
 
void write_byte (uint8_t data)
 
void write_array (const uint8_t *data, size_t len)
 
void write_array (const std::vector< uint8_t > &data)
 
template<size_t N>
void write_array (const std::array< uint8_t, N > &data)
 
void write_str (const char *str)
 
bool read_byte (uint8_t *data)
 
bool peek_byte (uint8_t *data)
 
bool read_array (uint8_t *data, size_t len)
 
template<size_t N>
optional< std::array< uint8_t, N > > read_array ()
 
int available ()
 
void flush ()
 
int read ()
 
size_t write (uint8_t data)
 
int peek ()
 
void check_uart_settings (uint32_t baud_rate, uint8_t stop_bits=1, UARTParityOptions parity=UART_CONFIG_PARITY_NONE, uint8_t data_bits=8)
 Check that the configuration of the UART bus matches the provided values and otherwise print a warning. More...
 

Protected Types

enum  Frame { INVALID, PARTIAL, CONSUMED }
 

Protected Member Functions

unsigned int get_frame_size_ (int led_count) const
 
void reset_frame_ (light::AddressableLight &it)
 
void blank_all_leds_ (light::AddressableLight &it)
 
Frame parse_frame_ (light::AddressableLight &it)
 
- Protected Member Functions inherited from esphome::light::AddressableLightEffect
AddressableLightget_addressable_ () const
 

Protected Attributes

uint32_t last_ack_ {0}
 
uint32_t last_byte_ {0}
 
uint32_t last_reset_ {0}
 
std::vector< uint8_t > frame_
 
- Protected Attributes inherited from esphome::light::LightEffect
LightStatestate_ {nullptr}
 
std::string name_
 
- Protected Attributes inherited from esphome::uart::UARTDevice
UARTComponentparent_ {nullptr}
 

Detailed Description

Definition at line 12 of file adalight_light_effect.h.

Member Enumeration Documentation

◆ Frame

Enumerator
INVALID 
PARTIAL 
CONSUMED 

Definition at line 21 of file adalight_light_effect.h.

Constructor & Destructor Documentation

◆ AdalightLightEffect()

esphome::adalight::AdalightLightEffect::AdalightLightEffect ( const std::string &  name)

Definition at line 12 of file adalight_light_effect.cpp.

Member Function Documentation

◆ apply()

void esphome::adalight::AdalightLightEffect::apply ( light::AddressableLight it,
const Color current_color 
)
overridevirtual

Implements esphome::light::AddressableLightEffect.

Definition at line 50 of file adalight_light_effect.cpp.

◆ blank_all_leds_()

void esphome::adalight::AdalightLightEffect::blank_all_leds_ ( light::AddressableLight it)
protected

Definition at line 43 of file adalight_light_effect.cpp.

◆ get_frame_size_()

unsigned int esphome::adalight::AdalightLightEffect::get_frame_size_ ( int  led_count) const
protected

Definition at line 28 of file adalight_light_effect.cpp.

◆ parse_frame_()

AdalightLightEffect::Frame esphome::adalight::AdalightLightEffect::parse_frame_ ( light::AddressableLight it)
protected

Definition at line 100 of file adalight_light_effect.cpp.

◆ reset_frame_()

void esphome::adalight::AdalightLightEffect::reset_frame_ ( light::AddressableLight it)
protected

Definition at line 36 of file adalight_light_effect.cpp.

◆ start()

void esphome::adalight::AdalightLightEffect::start ( )
overridevirtual

Reimplemented from esphome::light::LightEffect.

Definition at line 14 of file adalight_light_effect.cpp.

◆ stop()

void esphome::adalight::AdalightLightEffect::stop ( )
overridevirtual

Reimplemented from esphome::light::LightEffect.

Definition at line 22 of file adalight_light_effect.cpp.

Field Documentation

◆ frame_

std::vector<uint8_t> esphome::adalight::AdalightLightEffect::frame_
protected

Definition at line 35 of file adalight_light_effect.h.

◆ last_ack_

uint32_t esphome::adalight::AdalightLightEffect::last_ack_ {0}
protected

Definition at line 32 of file adalight_light_effect.h.

◆ last_byte_

uint32_t esphome::adalight::AdalightLightEffect::last_byte_ {0}
protected

Definition at line 33 of file adalight_light_effect.h.

◆ last_reset_

uint32_t esphome::adalight::AdalightLightEffect::last_reset_ {0}
protected

Definition at line 34 of file adalight_light_effect.h.


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