diff --git a/esphome/components/time/real_time_clock.h b/esphome/components/time/real_time_clock.h index 9fad148885..4b98a88975 100644 --- a/esphome/components/time/real_time_clock.h +++ b/esphome/components/time/real_time_clock.h @@ -40,7 +40,7 @@ class RealTimeClock : public PollingComponent { /// Get the current time as the UTC epoch since January 1st 1970. time_t timestamp_now() { return ::time(nullptr); } - void add_on_time_sync_callback(std::function callback) { + void add_on_time_sync_callback(std::function &&callback) { this->time_sync_callback_.add(std::move(callback)); };