ESPHome  2024.11.2
Public Member Functions | Protected Attributes
esphome::time::CronTrigger Class Reference

#include <automation.h>

Inheritance diagram for esphome::time::CronTrigger:
esphome::Trigger<> esphome::Component

Public Member Functions

 CronTrigger (RealTimeClock *rtc)
 
void add_second (uint8_t second)
 
void add_seconds (const std::vector< uint8_t > &seconds)
 
void add_minute (uint8_t minute)
 
void add_minutes (const std::vector< uint8_t > &minutes)
 
void add_hour (uint8_t hour)
 
void add_hours (const std::vector< uint8_t > &hours)
 
void add_day_of_month (uint8_t day_of_month)
 
void add_days_of_month (const std::vector< uint8_t > &days_of_month)
 
void add_month (uint8_t month)
 
void add_months (const std::vector< uint8_t > &months)
 
void add_day_of_week (uint8_t day_of_week)
 
void add_days_of_week (const std::vector< uint8_t > &days_of_week)
 
bool matches (const ESPTime &time)
 
void loop () override
 
float get_setup_priority () const override
 
- Public Member Functions inherited from esphome::Trigger<>
void trigger (Ts... x)
 Inform the parent automation that the event has triggered. More...
 
void set_automation_parent (Automation< Ts... > *automation_parent)
 
void stop_action ()
 Stop any action connected to this trigger. More...
 
bool is_action_running ()
 Returns true if any action connected to this trigger is running. More...
 
- Public Member Functions inherited from esphome::Component
virtual void setup ()
 Where the component's initialization should happen. More...
 
virtual void dump_config ()
 
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...
 

Protected Attributes

std::bitset< 61 > seconds_
 
std::bitset< 60 > minutes_
 
std::bitset< 24 > hours_
 
std::bitset< 32 > days_of_month_
 
std::bitset< 13 > months_
 
std::bitset< 8 > days_of_week_
 
RealTimeClockrtc_
 
optional< ESPTimelast_check_
 
- Protected Attributes inherited from esphome::Trigger<>
Automation< Ts... > * automation_parent_
 
- 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}
 

Additional Inherited Members

- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
 
virtual void call_setup ()
 
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...
 

Detailed Description

Definition at line 14 of file automation.h.

Constructor & Destructor Documentation

◆ CronTrigger()

esphome::time::CronTrigger::CronTrigger ( RealTimeClock rtc)
explicit

Definition at line 64 of file automation.cpp.

Member Function Documentation

◆ add_day_of_month()

void esphome::time::CronTrigger::add_day_of_month ( uint8_t  day_of_month)

Definition at line 17 of file automation.cpp.

◆ add_day_of_week()

void esphome::time::CronTrigger::add_day_of_week ( uint8_t  day_of_week)

Definition at line 19 of file automation.cpp.

◆ add_days_of_month()

void esphome::time::CronTrigger::add_days_of_month ( const std::vector< uint8_t > &  days_of_month)

Definition at line 77 of file automation.cpp.

◆ add_days_of_week()

void esphome::time::CronTrigger::add_days_of_week ( const std::vector< uint8_t > &  days_of_week)

Definition at line 85 of file automation.cpp.

◆ add_hour()

void esphome::time::CronTrigger::add_hour ( uint8_t  hour)

Definition at line 16 of file automation.cpp.

◆ add_hours()

void esphome::time::CronTrigger::add_hours ( const std::vector< uint8_t > &  hours)

Definition at line 73 of file automation.cpp.

◆ add_minute()

void esphome::time::CronTrigger::add_minute ( uint8_t  minute)

Definition at line 15 of file automation.cpp.

◆ add_minutes()

void esphome::time::CronTrigger::add_minutes ( const std::vector< uint8_t > &  minutes)

Definition at line 69 of file automation.cpp.

◆ add_month()

void esphome::time::CronTrigger::add_month ( uint8_t  month)

Definition at line 18 of file automation.cpp.

◆ add_months()

void esphome::time::CronTrigger::add_months ( const std::vector< uint8_t > &  months)

Definition at line 81 of file automation.cpp.

◆ add_second()

void esphome::time::CronTrigger::add_second ( uint8_t  second)

Definition at line 14 of file automation.cpp.

◆ add_seconds()

void esphome::time::CronTrigger::add_seconds ( const std::vector< uint8_t > &  seconds)

Definition at line 65 of file automation.cpp.

◆ get_setup_priority()

float esphome::time::CronTrigger::get_setup_priority ( ) const
overridevirtual

Reimplemented from esphome::Component.

Definition at line 89 of file automation.cpp.

◆ loop()

void esphome::time::CronTrigger::loop ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 24 of file automation.cpp.

◆ matches()

bool esphome::time::CronTrigger::matches ( const ESPTime time)

Definition at line 20 of file automation.cpp.

Field Documentation

◆ days_of_month_

std::bitset<32> esphome::time::CronTrigger::days_of_month_
protected

Definition at line 37 of file automation.h.

◆ days_of_week_

std::bitset<8> esphome::time::CronTrigger::days_of_week_
protected

Definition at line 39 of file automation.h.

◆ hours_

std::bitset<24> esphome::time::CronTrigger::hours_
protected

Definition at line 36 of file automation.h.

◆ last_check_

optional<ESPTime> esphome::time::CronTrigger::last_check_
protected

Definition at line 41 of file automation.h.

◆ minutes_

std::bitset<60> esphome::time::CronTrigger::minutes_
protected

Definition at line 35 of file automation.h.

◆ months_

std::bitset<13> esphome::time::CronTrigger::months_
protected

Definition at line 38 of file automation.h.

◆ rtc_

RealTimeClock* esphome::time::CronTrigger::rtc_
protected

Definition at line 40 of file automation.h.

◆ seconds_

std::bitset<61> esphome::time::CronTrigger::seconds_
protected

Definition at line 34 of file automation.h.


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