3#ifdef USE_DATETIME_DATE
9static const char *
const TAG =
"template.date";
12 if (this->
f_.has_value())
38 if (!this->
f_.has_value())
41 auto val = this->
f_();
42 if (
val.has_value()) {
51 bool has_year =
call.get_year().has_value();
52 bool has_month =
call.get_month().has_value();
53 bool has_day =
call.get_day().has_value();
100 LOG_DATETIME_DATE(
"",
"Template Date",
this);
101 ESP_LOGCONFIG(TAG,
" Optimistic: %s", YESNO(this->
optimistic_));
102 LOG_UPDATE_INTERVAL(
this);
ESPPreferenceObject make_entity_preference(uint32_t version=0)
Create a preference object for storing this entity's state/settings.
void trigger(const Ts &...x)
Inform the parent automation that the event has triggered.
optional< uint8_t > get_month() const
optional< uint8_t > get_day() const
optional< uint16_t > get_year() const
void dump_config() override
ESPPreferenceObject pref_
TemplateLambda< ESPTime > f_
void control(const datetime::DateCall &call) override
Trigger< ESPTime > set_trigger_
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]
void apply(DateEntity *date)