From 0039f1bb493153c28a6d4e0991b0f7aa69a840b2 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 23 Jul 2024 01:39:18 -0500 Subject: [PATCH] Make frontend url and route a cached_property (#122430) --- homeassistant/components/frontend/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py index 6b0d69ba99d..5b462842e4a 100644 --- a/homeassistant/components/frontend/__init__.py +++ b/homeassistant/components/frontend/__init__.py @@ -3,7 +3,7 @@ from __future__ import annotations from collections.abc import Callable, Iterator -from functools import lru_cache, partial +from functools import cached_property, lru_cache, partial import logging import os import pathlib @@ -588,12 +588,12 @@ class IndexView(web_urldispatcher.AbstractResource): self.hass = hass self._template_cache: jinja2.Template | None = None - @property + @cached_property def canonical(self) -> str: """Return resource's canonical path.""" return "/" - @property + @cached_property def _route(self) -> web_urldispatcher.ResourceRoute: """Return the index route.""" return web_urldispatcher.ResourceRoute("GET", self.get, self)