3#ifdef USE_DATETIME_TIME
9static const char *
const TAG =
"template.time";
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_hour =
call.get_hour().has_value();
52 bool has_minute =
call.get_minute().has_value();
53 bool has_second =
call.get_second().has_value();
100 LOG_DATETIME_TIME(
"",
"Template Time",
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_hour() const
optional< uint8_t > get_second() const
optional< uint8_t > get_minute() const
Trigger< ESPTime > set_trigger_
TemplateLambda< ESPTime > f_
void control(const datetime::TimeCall &call) override
void dump_config() override
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]
void apply(TimeEntity *time)