17 void set_interval(
Component *component,
const std::string &name, uint32_t interval, std::function<
void()> func);
20 void set_retry(
Component *component,
const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts,
21 std::function<
RetryResult(uint8_t)> func,
float backoff_increase_factor = 1.0f);
48 if (next_exec < this->last_execution)
50 return next_exec_major;
53 static bool cmp(
const std::unique_ptr<SchedulerItem> &a,
const std::unique_ptr<SchedulerItem> &b);
69 void push_(std::unique_ptr<SchedulerItem> item);
73 return this->
items_.empty();
77 std::vector<std::unique_ptr<SchedulerItem>>
items_;
78 std::vector<std::unique_ptr<SchedulerItem>>
to_add_;
std::function< void()> callback
void push_(std::unique_ptr< SchedulerItem > item)
const char * get_type_str()
uint8_t last_execution_major
bool cancel_timeout(Component *component, const std::string &name)
uint8_t next_execution_major()
optional< uint32_t > next_schedule_in()
void set_retry(Component *component, const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> func, float backoff_increase_factor=1.0f)
std::vector< std::unique_ptr< SchedulerItem > > to_add_
bool cancel_retry(Component *component, const std::string &name)
uint32_t next_execution()
bool cancel_item_(Component *component, const std::string &name, SchedulerItem::Type type)
static bool cmp(const std::unique_ptr< SchedulerItem > &a, const std::unique_ptr< SchedulerItem > &b)
bool cancel_interval(Component *component, const std::string &name)
void set_timeout(Component *component, const std::string &name, uint32_t timeout, std::function< void()> func)
Implementation of SPI Controller mode.
enum esphome::Scheduler::SchedulerItem::Type type
std::vector< std::unique_ptr< SchedulerItem > > items_
void set_interval(Component *component, const std::string &name, uint32_t interval, std::function< void()> func)
Mutex implementation, with API based on the unavailable std::mutex.