3#ifdef USE_DATETIME_DATETIME
9static const char *
const TAG =
"template.datetime";
12 if (this->
f_.has_value())
41 if (!this->
f_.has_value())
44 auto val = this->
f_();
45 if (
val.has_value()) {
57 bool has_year =
call.get_year().has_value();
58 bool has_month =
call.get_month().has_value();
59 bool has_day =
call.get_day().has_value();
60 bool has_hour =
call.get_hour().has_value();
61 bool has_minute =
call.get_minute().has_value();
62 bool has_second =
call.get_second().has_value();
139 LOG_DATETIME_DATETIME(
"",
"Template DateTime",
this);
140 ESP_LOGCONFIG(TAG,
" Optimistic: %s", YESNO(this->
optimistic_));
141 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< uint16_t > get_year() const
optional< uint8_t > get_hour() const
optional< uint8_t > get_month() const
optional< uint8_t > get_minute() const
optional< uint8_t > get_day() const
optional< uint8_t > get_second() const
void control(const datetime::DateTimeCall &call) override
Trigger< ESPTime > set_trigger_
void dump_config() override
TemplateLambda< ESPTime > f_
ESPPreferenceObject pref_
A more user-friendly version of struct tm from time.h.
uint8_t minute
minutes after the hour [0-59]
uint8_t second
seconds after the minute [0-60]
uint8_t hour
hours since midnight [0-23]
uint8_t day_of_month
day of the month [1-31]
uint8_t month
month; january=1 [1-12]
void apply(DateTimeEntity *datetime)