1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 17:49:37 +01:00

Avoid expensive inspect calls in config validators (#112085)

* Avoid expensive inspect calls in config validators

inspect has a performance problem https://github.com/python/cpython/issues/92041

We now avoid calling inspect unless we are going to log

* remove unused

* reduce

* get_integration_logger
This commit is contained in:
J. Nick Koston
2024-03-02 16:50:35 -10:00
committed by GitHub
parent 9353ad0690
commit 6421a08ba8
5 changed files with 101 additions and 59 deletions
@@ -1,8 +1,15 @@
"""An integration which calls helpers.frame.get_integration_frame."""
import logging
from homeassistant.helpers import frame
def call_get_integration_logger(fallback_name: str) -> logging.Logger:
"""Call get_integration_logger."""
return frame.get_integration_logger(fallback_name)
def call_get_integration_frame() -> frame.IntegrationFrame:
"""Call get_integration_frame."""
return frame.get_integration_frame()