ESPHome  2024.10.2
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
esphome::lvgl::LvglComponent Class Reference

#include <lvgl_esphome.h>

Inheritance diagram for esphome::lvgl::LvglComponent:
esphome::PollingComponent esphome::Component

Public Member Functions

float get_setup_priority () const override
 
void setup () override
 
void update () override
 
void loop () override
 
void add_on_idle_callback (std::function< void(uint32_t)> &&callback)
 
void add_display (display::Display *display)
 
void add_init_lambda (const std::function< void(LvglComponent *)> &lamb)
 
void dump_config () override
 
void set_full_refresh (bool full_refresh)
 
bool is_idle (uint32_t idle_ms)
 
void set_buffer_frac (size_t frac)
 
lv_disp_t * get_disp ()
 
void set_paused (bool paused, bool show_snow)
 
void add_event_cb (lv_obj_t *obj, event_callback_t callback, lv_event_code_t event)
 
void add_event_cb (lv_obj_t *obj, event_callback_t callback, lv_event_code_t event1, lv_event_code_t event2)
 
void add_event_cb (lv_obj_t *obj, event_callback_t callback, lv_event_code_t event1, lv_event_code_t event2, lv_event_code_t event3)
 
bool is_paused () const
 
void add_page (LvPageType *page)
 
void show_page (size_t index, lv_scr_load_anim_t anim, uint32_t time)
 
void show_next_page (lv_scr_load_anim_t anim, uint32_t time)
 
void show_prev_page (lv_scr_load_anim_t anim, uint32_t time)
 
void set_page_wrap (bool wrap)
 
void set_focus_mark (lv_group_t *group)
 
void restore_focus_mark (lv_group_t *group)
 
- Public Member Functions inherited from esphome::PollingComponent
 PollingComponent ()
 
 PollingComponent (uint32_t update_interval)
 Initialize this polling component with the given update interval in ms. More...
 
virtual void set_update_interval (uint32_t update_interval)
 Manually set the update interval in ms for this polling object. More...
 
void call_setup () override
 
virtual uint32_t get_update_interval () const
 Get the update interval in ms of this sensor. More...
 
void start_poller ()
 
void stop_poller ()
 
- Public Member Functions inherited from esphome::Component
float get_actual_setup_priority () const
 
void set_setup_priority (float priority)
 
virtual float get_loop_priority () const
 priority of loop(). More...
 
void call ()
 
virtual void on_shutdown ()
 
virtual void on_safe_shutdown ()
 
uint32_t get_component_state () const
 
virtual void mark_failed ()
 Mark this component as failed. More...
 
bool is_failed () const
 
bool is_ready () const
 
virtual bool can_proceed ()
 
bool status_has_warning () const
 
bool status_has_error () const
 
void status_set_warning (const char *message="unspecified")
 
void status_set_error (const char *message="unspecified")
 
void status_clear_warning ()
 
void status_clear_error ()
 
void status_momentary_warning (const std::string &name, uint32_t length=5000)
 
void status_momentary_error (const std::string &name, uint32_t length=5000)
 
bool has_overridden_loop () const
 
void set_component_source (const char *source)
 Set where this component was loaded from for some debug messages. More...
 
const char * get_component_source () const
 Get the integration where this component was declared as a string. More...
 

Static Public Member Functions

static void static_flush_cb (lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p)
 

Protected Member Functions

void write_random_ ()
 
void draw_buffer_ (const lv_area_t *area, const uint8_t *ptr)
 
void flush_cb_ (lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p)
 
- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
 
virtual void call_dump_config ()
 
void set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a unique name. More...
 
void set_interval (uint32_t interval, std::function< void()> &&f)
 
bool cancel_interval (const std::string &name)
 Cancel an interval function. More...
 
void set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f)
 Set an retry function with a unique name. More...
 
void set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f)
 
bool cancel_retry (const std::string &name)
 Cancel a retry function. More...
 
void set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a unique name. More...
 
void set_timeout (uint32_t timeout, std::function< void()> &&f)
 
bool cancel_timeout (const std::string &name)
 Cancel a timeout function. More...
 
void defer (const std::string &name, std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
void defer (std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
bool cancel_defer (const std::string &name)
 Cancel a defer callback using the specified name, name must not be empty. More...
 

Protected Attributes

std::vector< display::Display * > displays_ {}
 
lv_disp_draw_buf_t draw_buf_ {}
 
lv_disp_drv_t disp_drv_ {}
 
lv_disp_t * disp_ {}
 
bool paused_ {}
 
std::vector< LvPageType * > pages_ {}
 
size_t current_page_ {0}
 
bool show_snow_ {}
 
lv_coord_t snow_line_ {}
 
bool page_wrap_ {true}
 
std::map< lv_group_t *, lv_obj_t * > focus_marks_ {}
 
std::vector< std::function< void(LvglComponent *lv_component)> > init_lambdas_
 
CallbackManager< void(uint32_t)> idle_callbacks_ {}
 
size_t buffer_frac_ {1}
 
bool full_refresh_ {}
 
- Protected Attributes inherited from esphome::PollingComponent
uint32_t update_interval_
 
- Protected Attributes inherited from esphome::Component
uint32_t component_state_ {0x0000}
 State of this component. More...
 
float setup_priority_override_ {NAN}
 
const char * component_source_ {nullptr}
 

Detailed Description

Definition at line 109 of file lvgl_esphome.h.

Member Function Documentation

◆ add_display()

void esphome::lvgl::LvglComponent::add_display ( display::Display display)
inline

Definition at line 122 of file lvgl_esphome.h.

◆ add_event_cb() [1/3]

void esphome::lvgl::LvglComponent::add_event_cb ( lv_obj_t *  obj,
event_callback_t  callback,
lv_event_code_t  event 
)

Definition at line 96 of file lvgl_esphome.cpp.

◆ add_event_cb() [2/3]

void esphome::lvgl::LvglComponent::add_event_cb ( lv_obj_t *  obj,
event_callback_t  callback,
lv_event_code_t  event1,
lv_event_code_t  event2 
)

Definition at line 99 of file lvgl_esphome.cpp.

◆ add_event_cb() [3/3]

void esphome::lvgl::LvglComponent::add_event_cb ( lv_obj_t *  obj,
event_callback_t  callback,
lv_event_code_t  event1,
lv_event_code_t  event2,
lv_event_code_t  event3 
)

Definition at line 104 of file lvgl_esphome.cpp.

◆ add_init_lambda()

void esphome::lvgl::LvglComponent::add_init_lambda ( const std::function< void(LvglComponent *)> &  lamb)
inline

Definition at line 123 of file lvgl_esphome.h.

◆ add_on_idle_callback()

void esphome::lvgl::LvglComponent::add_on_idle_callback ( std::function< void(uint32_t)> &&  callback)
inline

Definition at line 119 of file lvgl_esphome.h.

◆ add_page()

void esphome::lvgl::LvglComponent::add_page ( LvPageType page)

Definition at line 110 of file lvgl_esphome.cpp.

◆ draw_buffer_()

void esphome::lvgl::LvglComponent::draw_buffer_ ( const lv_area_t *  area,
const uint8_t *  ptr 
)
protected

Definition at line 136 of file lvgl_esphome.cpp.

◆ dump_config()

void esphome::lvgl::LvglComponent::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 86 of file lvgl_esphome.cpp.

◆ flush_cb_()

void esphome::lvgl::LvglComponent::flush_cb_ ( lv_disp_drv_t *  disp_drv,
const lv_area_t *  area,
lv_color_t *  color_p 
)
protected

Definition at line 143 of file lvgl_esphome.cpp.

◆ get_disp()

lv_disp_t* esphome::lvgl::LvglComponent::get_disp ( )
inline

Definition at line 128 of file lvgl_esphome.h.

◆ get_setup_priority()

float esphome::lvgl::LvglComponent::get_setup_priority ( ) const
inlineoverridevirtual

Reimplemented from esphome::Component.

Definition at line 115 of file lvgl_esphome.h.

◆ is_idle()

bool esphome::lvgl::LvglComponent::is_idle ( uint32_t  idle_ms)
inline

Definition at line 126 of file lvgl_esphome.h.

◆ is_paused()

bool esphome::lvgl::LvglComponent::is_paused ( ) const
inline

Definition at line 134 of file lvgl_esphome.h.

◆ loop()

void esphome::lvgl::LvglComponent::loop ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 344 of file lvgl_esphome.cpp.

◆ restore_focus_mark()

void esphome::lvgl::LvglComponent::restore_focus_mark ( lv_group_t *  group)
inline

Definition at line 141 of file lvgl_esphome.h.

◆ set_buffer_frac()

void esphome::lvgl::LvglComponent::set_buffer_frac ( size_t  frac)
inline

Definition at line 127 of file lvgl_esphome.h.

◆ set_focus_mark()

void esphome::lvgl::LvglComponent::set_focus_mark ( lv_group_t *  group)
inline

Definition at line 140 of file lvgl_esphome.h.

◆ set_full_refresh()

void esphome::lvgl::LvglComponent::set_full_refresh ( bool  full_refresh)
inline

Definition at line 125 of file lvgl_esphome.h.

◆ set_page_wrap()

void esphome::lvgl::LvglComponent::set_page_wrap ( bool  wrap)
inline

Definition at line 139 of file lvgl_esphome.h.

◆ set_paused()

void esphome::lvgl::LvglComponent::set_paused ( bool  paused,
bool  show_snow 
)

Definition at line 87 of file lvgl_esphome.cpp.

◆ setup()

void esphome::lvgl::LvglComponent::setup ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 283 of file lvgl_esphome.cpp.

◆ show_next_page()

void esphome::lvgl::LvglComponent::show_next_page ( lv_scr_load_anim_t  anim,
uint32_t  time 
)

Definition at line 120 of file lvgl_esphome.cpp.

◆ show_page()

void esphome::lvgl::LvglComponent::show_page ( size_t  index,
lv_scr_load_anim_t  anim,
uint32_t  time 
)

Definition at line 114 of file lvgl_esphome.cpp.

◆ show_prev_page()

void esphome::lvgl::LvglComponent::show_prev_page ( lv_scr_load_anim_t  anim,
uint32_t  time 
)

Definition at line 128 of file lvgl_esphome.cpp.

◆ static_flush_cb()

void esphome::lvgl::LvglComponent::static_flush_cb ( lv_disp_drv_t *  disp_drv,
const lv_area_t *  area,
lv_color_t *  color_p 
)
static

Definition at line 368 of file lvgl_esphome.cpp.

◆ update()

void esphome::lvgl::LvglComponent::update ( )
overridevirtual

Implements esphome::PollingComponent.

Definition at line 337 of file lvgl_esphome.cpp.

◆ write_random_()

void esphome::lvgl::LvglComponent::write_random_ ( )
protected

Definition at line 263 of file lvgl_esphome.cpp.

Field Documentation

◆ buffer_frac_

size_t esphome::lvgl::LvglComponent::buffer_frac_ {1}
protected

Definition at line 166 of file lvgl_esphome.h.

◆ current_page_

size_t esphome::lvgl::LvglComponent::current_page_ {0}
protected

Definition at line 158 of file lvgl_esphome.h.

◆ disp_

lv_disp_t* esphome::lvgl::LvglComponent::disp_ {}
protected

Definition at line 155 of file lvgl_esphome.h.

◆ disp_drv_

lv_disp_drv_t esphome::lvgl::LvglComponent::disp_drv_ {}
protected

Definition at line 154 of file lvgl_esphome.h.

◆ displays_

std::vector<display::Display *> esphome::lvgl::LvglComponent::displays_ {}
protected

Definition at line 152 of file lvgl_esphome.h.

◆ draw_buf_

lv_disp_draw_buf_t esphome::lvgl::LvglComponent::draw_buf_ {}
protected

Definition at line 153 of file lvgl_esphome.h.

◆ focus_marks_

std::map<lv_group_t *, lv_obj_t *> esphome::lvgl::LvglComponent::focus_marks_ {}
protected

Definition at line 162 of file lvgl_esphome.h.

◆ full_refresh_

bool esphome::lvgl::LvglComponent::full_refresh_ {}
protected

Definition at line 167 of file lvgl_esphome.h.

◆ idle_callbacks_

CallbackManager<void(uint32_t)> esphome::lvgl::LvglComponent::idle_callbacks_ {}
protected

Definition at line 165 of file lvgl_esphome.h.

◆ init_lambdas_

std::vector<std::function<void(LvglComponent *lv_component)> > esphome::lvgl::LvglComponent::init_lambdas_
protected

Definition at line 164 of file lvgl_esphome.h.

◆ page_wrap_

bool esphome::lvgl::LvglComponent::page_wrap_ {true}
protected

Definition at line 161 of file lvgl_esphome.h.

◆ pages_

std::vector<LvPageType *> esphome::lvgl::LvglComponent::pages_ {}
protected

Definition at line 157 of file lvgl_esphome.h.

◆ paused_

bool esphome::lvgl::LvglComponent::paused_ {}
protected

Definition at line 156 of file lvgl_esphome.h.

◆ show_snow_

bool esphome::lvgl::LvglComponent::show_snow_ {}
protected

Definition at line 159 of file lvgl_esphome.h.

◆ snow_line_

lv_coord_t esphome::lvgl::LvglComponent::snow_line_ {}
protected

Definition at line 160 of file lvgl_esphome.h.


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