5#ifdef USE_DATETIME_TIME
16#define LOG_DATETIME_TIME(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()); \
106 void play(Ts...
x)
override {
107 auto call = this->
parent_->make_call();
109 if (this->time_.has_value()) {
110 call.set_time(this->time_.value(
x...));
119 void loop()
override;
virtual void play(Ts... x)=0
Helper class to easily give an object a parent of type T.
bool matches_(const ESPTime &time) const
optional< ESPTime > last_check_
optional< uint8_t > second_
TimeCall & set_hour(uint8_t hour)
optional< uint8_t > hour_
TimeCall & set_minute(uint8_t minute)
TimeCall(TimeEntity *parent)
optional< uint8_t > get_hour() const
optional< uint8_t > minute_
optional< uint8_t > get_second() const
TimeCall & set_second(uint8_t second)
optional< uint8_t > get_minute() const
TimeCall & set_time(uint8_t hour, uint8_t minute, uint8_t second)
ESPTime state_as_esptime() const override
virtual void control(const TimeCall &call)=0
TEMPLATABLE_VALUE(ESPTime, time) 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 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)
TimeCall to_call(TimeEntity *time)