5 #ifdef USE_DATETIME_DATE 16 #define LOG_DATETIME_DATE(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()); \ 48 obj.
year = this->year_;
49 obj.
month = this->month_;
54 const uint16_t &
year = year_;
56 const uint8_t &
day = day_;
62 virtual void control(
const DateCall &call) = 0;
71 DateCall &set_date(
const std::string &date);
104 void play(Ts...
x)
override {
105 auto call = this->parent_->make_call();
107 if (this->date_.has_value()) {
108 call.set_date(this->date_.value(
x...));
117 #endif // USE_DATETIME_DATE DateCall & set_year(uint16_t year)
DateCall & set_month(uint8_t month)
optional< uint8_t > month_
A more user-friendly version of struct tm from time.h.
DateCall(DateEntity *parent)
TEMPLATABLE_VALUE(ESPTime, date) void play(Ts... x) override
optional< uint8_t > get_day() const
optional< int16_t > year_
ESPTime state_as_esptime() const override
DateCall & set_day(uint8_t day)
optional< uint16_t > get_year() const
esphome::datetime::DateEntity __attribute__
DateCall to_call(DateEntity *date)
Implementation of SPI Controller mode.
uint8_t month
month; january=1 [1-12]
optional< uint8_t > get_month() const
void apply(DateEntity *date)
uint8_t day_of_month
day of the month [1-31]
Helper class to easily give an object a parent of type T.