From 7ab5443622d6b002f5a1da2f4c25514d5033073e Mon Sep 17 00:00:00 2001 From: Oliver Kleinecke Date: Tue, 18 Feb 2025 11:13:45 +0100 Subject: [PATCH] fix: update timer date handling in DynamicLampComponent to use timestamp for accuracy --- esphome/components/dynamic_lamp/dynamic_lamp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/dynamic_lamp/dynamic_lamp.cpp b/esphome/components/dynamic_lamp/dynamic_lamp.cpp index db74d359cf..67ae1e4705 100644 --- a/esphome/components/dynamic_lamp/dynamic_lamp.cpp +++ b/esphome/components/dynamic_lamp/dynamic_lamp.cpp @@ -244,8 +244,8 @@ bool DynamicLampComponent::add_timer(std::string lamp_name, bool timer_active, u new_timer.saturday = saturday; new_timer.sunday = sunday; ESPTime now = this->rtc_->now(); - time_t begin_date = now.to_c_tm(); - time_t end_date = now.increment_day(1).to_c_tm(); + time_t begin_date = now.timestamp; + time_t end_date = now.increment_day().timestamp; new_timer.begin_date = begin_date; new_timer.end_date = end_date; ESP_LOGV(TAG, "Added new timer for lamp %s, active %d, mode %d, hour %d, minute %d, monday %d, tuesday %d, wednesday %d, thursday %d, friday %d, saturday %d, sunday %d",