From f3cf0f62a93988b537136318ae5c1fe25c4d3822 Mon Sep 17 00:00:00 2001 From: Pete Date: Tue, 3 Dec 2024 12:31:14 +0100 Subject: [PATCH] FIX: make "year" period work in leap year --- homeassistant/components/recorder/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/recorder/util.py b/homeassistant/components/recorder/util.py index a59519ef38dfa7..125b354211eb5d 100644 --- a/homeassistant/components/recorder/util.py +++ b/homeassistant/components/recorder/util.py @@ -902,7 +902,7 @@ def resolve_period( start_time = (start_time + timedelta(days=cal_offset * 366)).replace( month=1, day=1 ) - end_time = (start_time + timedelta(days=365)).replace(day=1) + end_time = (start_time + timedelta(days=366)).replace(day=1) start_time = dt_util.as_utc(start_time) end_time = dt_util.as_utc(end_time)