5 #ifdef USE_DATETIME_DATETIME 16 #define LOG_DATETIME_DATETIME(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()); \ 52 ESPTime state_as_esptime()
const override;
54 const uint16_t &
year = year_;
56 const uint8_t &
day = day_;
57 const uint8_t &
hour = hour_;
127 void play(Ts...
x)
override {
128 auto call = this->parent_->make_call();
130 if (this->datetime_.has_value()) {
131 call.set_datetime(this->datetime_.value(
x...));
139 void loop()
override;
142 bool matches_(
const ESPTime &time)
const;
150 #endif // USE_DATETIME_DATETIME void apply(DateTimeEntity *datetime)
DateTimeCall & set_minute(uint8_t minute)
optional< ESPTime > last_check_
optional< uint16_t > get_year() const
DateTimeCall & set_hour(uint8_t hour)
DateTimeCall & set_second(uint8_t second)
optional< uint8_t > get_day() const
DateTimeCall & set_year(uint16_t year)
optional< uint8_t > get_second() const
A more user-friendly version of struct tm from time.h.
TEMPLATABLE_VALUE(ESPTime, datetime) void play(Ts... x) override
DateTimeCall & set_day(uint8_t day)
optional< uint16_t > year_
DateTimeCall(DateTimeEntity *parent)
optional< uint8_t > get_month() const
optional< uint8_t > second_
optional< uint8_t > get_hour() const
DateTimeCall & set_month(uint8_t month)
optional< uint8_t > hour_
esphome::datetime::DateEntity __attribute__
Implementation of SPI Controller mode.
DateTimeCall to_call(DateTimeEntity *datetime)
optional< uint8_t > month_
optional< uint8_t > minute_
optional< uint8_t > get_minute() const
Helper class to easily give an object a parent of type T.