From 76cd498c443ec3f698e4b23737bf800a1d81719d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 5 May 2024 15:25:27 -0500 Subject: [PATCH] Replace utcnow().timestamp() with time.time() in auth_store (#116879) utcnow().timestamp() is a slower way to get time.time() --- homeassistant/auth/auth_store.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/auth/auth_store.py b/homeassistant/auth/auth_store.py index b3481acca3c..826bec57ee6 100644 --- a/homeassistant/auth/auth_store.py +++ b/homeassistant/auth/auth_store.py @@ -6,6 +6,7 @@ from datetime import timedelta import hmac import itertools from logging import getLogger +import time from typing import Any from homeassistant.core import HomeAssistant, callback @@ -290,7 +291,7 @@ class AuthStore: perm_lookup = PermissionLookup(ent_reg, dev_reg) self._perm_lookup = perm_lookup - now_ts = dt_util.utcnow().timestamp() + now_ts = time.time() if data is None or not isinstance(data, dict): self._set_defaults()