mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Make frontend url and route a cached_property (#122430)
This commit is contained in:
parent
975cfa6457
commit
0039f1bb49
@ -3,7 +3,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Callable, Iterator
|
from collections.abc import Callable, Iterator
|
||||||
from functools import lru_cache, partial
|
from functools import cached_property, lru_cache, partial
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
@ -588,12 +588,12 @@ class IndexView(web_urldispatcher.AbstractResource):
|
|||||||
self.hass = hass
|
self.hass = hass
|
||||||
self._template_cache: jinja2.Template | None = None
|
self._template_cache: jinja2.Template | None = None
|
||||||
|
|
||||||
@property
|
@cached_property
|
||||||
def canonical(self) -> str:
|
def canonical(self) -> str:
|
||||||
"""Return resource's canonical path."""
|
"""Return resource's canonical path."""
|
||||||
return "/"
|
return "/"
|
||||||
|
|
||||||
@property
|
@cached_property
|
||||||
def _route(self) -> web_urldispatcher.ResourceRoute:
|
def _route(self) -> web_urldispatcher.ResourceRoute:
|
||||||
"""Return the index route."""
|
"""Return the index route."""
|
||||||
return web_urldispatcher.ResourceRoute("GET", self.get, self)
|
return web_urldispatcher.ResourceRoute("GET", self.get, self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user