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()); \ 49 obj.
hour = this->hour_;
50 obj.
minute = this->minute_;
51 obj.
second = this->second_;
55 const uint8_t &
hour = hour_;
64 virtual void control(
const TimeCall &call) = 0;
73 TimeCall &set_time(
const std::string &time);
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;
122 bool matches_(
const ESPTime &time)
const;
131 #endif // USE_DATETIME_TIME TEMPLATABLE_VALUE(ESPTime, time) void play(Ts... x) override
ESPTime state_as_esptime() const override
optional< uint8_t > get_hour() const
optional< uint8_t > hour_
A more user-friendly version of struct tm from time.h.
void apply(TimeEntity *time)
TimeCall & set_minute(uint8_t minute)
TimeCall(TimeEntity *parent)
TimeCall & set_second(uint8_t second)
uint8_t second
seconds after the minute [0-60]
uint8_t minute
minutes after the hour [0-59]
optional< uint8_t > minute_
optional< ESPTime > last_check_
optional< uint8_t > get_minute() const
TimeCall to_call(TimeEntity *time)
esphome::datetime::DateEntity __attribute__
optional< uint8_t > get_second() const
optional< uint8_t > second_
Implementation of SPI Controller mode.
TimeCall & set_hour(uint8_t hour)
uint8_t hour
hours since midnight [0-23]
Helper class to easily give an object a parent of type T.