5 #ifdef USE_DATETIME_TIME 20 #define LOG_DATETIME_TIME(prefix, type, obj) \ 21 if ((obj) != nullptr) { \ 22 ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, LOG_STR_LITERAL(type), (obj)->get_name().c_str()); \ 23 if (!(obj)->get_icon().empty()) { \ 24 ESP_LOGCONFIG(TAG, "%s Icon: '%s'", prefix, (obj)->get_icon().c_str()); \ 52 obj.
hour = this->hour_;
53 obj.
minute = this->minute_;
54 obj.
second = this->second_;
58 const uint8_t &
hour = hour_;
66 virtual void control(
const TimeCall &call) = 0;
75 TimeCall &set_time(
const std::string &time);
108 void play(Ts...
x)
override {
109 auto call = this->parent_->make_call();
111 if (this->time_.has_value()) {
112 call.set_time(this->time_.value(
x...));
123 void loop()
override;
126 bool matches_(
const ESPTime &time)
const;
137 #endif // USE_DATETIME_TIME TEMPLATABLE_VALUE(ESPTime, time) void play(Ts... x) override
ESPTime state_as_esptime() const override
time::RealTimeClock * rtc_
optional< uint8_t > get_hour() const
optional< uint8_t > hour_
The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock...
A more user-friendly version of struct tm from time.h.
void apply(TimeEntity *time)
OnTimeTrigger(time::RealTimeClock *rtc)
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_
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
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.