From 484027023cd8c92d8d0c588cc6329cf8f3c7e075 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 13 Feb 2023 21:53:37 -0600 Subject: [PATCH] Fix new stats rows creating data in the old created column (#88013) --- homeassistant/components/recorder/db_schema.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/recorder/db_schema.py b/homeassistant/components/recorder/db_schema.py index 19ed9fbe4bd..9c9c4071776 100644 --- a/homeassistant/components/recorder/db_schema.py +++ b/homeassistant/components/recorder/db_schema.py @@ -537,6 +537,8 @@ class StatisticsBase: """Create object from a statistics.""" return cls( # type: ignore[call-arg] metadata_id=metadata_id, + created=None, + created_ts=time.time(), start=None, start_ts=dt_util.utc_to_timestamp(stats["start"]), mean=stats.get("mean"),