diff --git a/esphome/components/time/real_time_clock.h b/esphome/components/time/real_time_clock.h index a17168ae6f..4dea7f768b 100644 --- a/esphome/components/time/real_time_clock.h +++ b/esphome/components/time/real_time_clock.h @@ -23,6 +23,8 @@ class RealTimeClock : public PollingComponent { /// Set the time zone. void set_timezone(const std::string &tz) { this->timezone_ = tz; } + void set_time(uint32_t epoch) { this->synchronize_epoch_(epoch); } + /// Get the time zone currently in use. std::string get_timezone() { return this->timezone_; }