ESPHome  1.15.2
Data Structures | Public Member Functions | Protected Member Functions | Protected Attributes
esphome::Scheduler Class Reference

#include <scheduler.h>

Data Structures

struct  SchedulerItem
 

Public Member Functions

void set_timeout (Component *component, const std::string &name, uint32_t timeout, std::function< void()> &&func)
 
bool cancel_timeout (Component *component, const std::string &name)
 
void set_interval (Component *component, const std::string &name, uint32_t interval, std::function< void()> &&func)
 
bool cancel_interval (Component *component, const std::string &name)
 
optional< uint32_t > next_schedule_in ()
 
void call ()
 
void process_to_add ()
 

Protected Member Functions

uint32_t millis_ ()
 
void cleanup_ ()
 
void pop_raw_ ()
 
void push_ (std::unique_ptr< SchedulerItem > item)
 
bool cancel_item_ (Component *component, const std::string &name, SchedulerItem::Type type)
 
bool empty_ ()
 

Protected Attributes

std::vector< std::unique_ptr< SchedulerItem > > items_
 
std::vector< std::unique_ptr< SchedulerItem > > to_add_
 
uint32_t last_millis_ {0}
 
uint8_t millis_major_ {0}
 

Detailed Description

Definition at line 11 of file scheduler.h.

Member Function Documentation

◆ call()

void ICACHE_RAM_ATTR HOT esphome::Scheduler::call ( )

Definition at line 84 of file scheduler.cpp.

◆ cancel_interval()

bool HOT esphome::Scheduler::cancel_interval ( Component component,
const std::string &  name 
)

Definition at line 71 of file scheduler.cpp.

◆ cancel_item_()

bool HOT esphome::Scheduler::cancel_item_ ( Component component,
const std::string &  name,
SchedulerItem::Type  type 
)
protected

Definition at line 193 of file scheduler.cpp.

◆ cancel_timeout()

bool HOT esphome::Scheduler::cancel_timeout ( Component component,
const std::string &  name 
)

Definition at line 38 of file scheduler.cpp.

◆ cleanup_()

void HOT esphome::Scheduler::cleanup_ ( )
protected

Definition at line 179 of file scheduler.cpp.

◆ empty_()

bool esphome::Scheduler::empty_ ( )
inlineprotected

Definition at line 55 of file scheduler.h.

◆ millis_()

uint32_t esphome::Scheduler::millis_ ( )
protected

Definition at line 208 of file scheduler.cpp.

◆ next_schedule_in()

optional< uint32_t > HOT esphome::Scheduler::next_schedule_in ( )

Definition at line 74 of file scheduler.cpp.

◆ pop_raw_()

void HOT esphome::Scheduler::pop_raw_ ( )
protected

Definition at line 188 of file scheduler.cpp.

◆ process_to_add()

void HOT esphome::Scheduler::process_to_add ( )

Definition at line 168 of file scheduler.cpp.

◆ push_()

void HOT esphome::Scheduler::push_ ( std::unique_ptr< SchedulerItem item)
protected

Definition at line 192 of file scheduler.cpp.

◆ set_interval()

void HOT esphome::Scheduler::set_interval ( Component component,
const std::string &  name,
uint32_t  interval,
std::function< void()> &&  func 
)

Definition at line 41 of file scheduler.cpp.

◆ set_timeout()

void HOT esphome::Scheduler::set_timeout ( Component component,
const std::string &  name,
uint32_t  timeout,
std::function< void()> &&  func 
)

Definition at line 15 of file scheduler.cpp.

Field Documentation

◆ items_

std::vector<std::unique_ptr<SchedulerItem> > esphome::Scheduler::items_
protected

Definition at line 60 of file scheduler.h.

◆ last_millis_

uint32_t esphome::Scheduler::last_millis_ {0}
protected

Definition at line 62 of file scheduler.h.

◆ millis_major_

uint8_t esphome::Scheduler::millis_major_ {0}
protected

Definition at line 63 of file scheduler.h.

◆ to_add_

std::vector<std::unique_ptr<SchedulerItem> > esphome::Scheduler::to_add_
protected

Definition at line 61 of file scheduler.h.


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