5#ifdef USE_DATETIME_DATE
16#define LOG_DATETIME_DATE(prefix, type, obj) \
17 if ((obj) != nullptr) { \
18 ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, LOG_STR_LITERAL(type), (obj)->get_name().c_str()); \
19 if (!(obj)->get_icon().empty()) { \
20 ESP_LOGCONFIG(TAG, "%s Icon: '%s'", prefix, (obj)->get_icon().c_str()); \
104 void play(Ts...
x)
override {
105 auto call = this->
parent_->make_call();
107 if (this->date_.has_value()) {
108 call.set_date(this->date_.value(
x...));
virtual void play(Ts... x)=0
Helper class to easily give an object a parent of type T.
DateCall & set_date(uint16_t year, uint8_t month, uint8_t day)
optional< uint8_t > month_
optional< int16_t > year_
DateCall(DateEntity *parent)
optional< uint8_t > get_month() const
DateCall & set_month(uint8_t month)
optional< uint8_t > get_day() const
DateCall & set_day(uint8_t day)
optional< uint16_t > get_year() const
DateCall & set_year(uint16_t year)
ESPTime state_as_esptime() const override
virtual void control(const DateCall &call)=0
TEMPLATABLE_VALUE(ESPTime, date) void play(Ts... x) override
esphome::datetime::DateEntity __attribute__
Providing packet encoding functions for exchanging data with a remote host.
A more user-friendly version of struct tm from time.h.
uint8_t day_of_month
day of the month [1-31]
uint8_t month
month; january=1 [1-12]
DateCall to_call(DateEntity *date)
void apply(DateEntity *date)