393 files
This commit is contained in:
@@ -111,12 +111,10 @@ class EntityAnalyzer:
|
||||
async def _async_fetch_statistics(self, entity_id: str) -> StatisticsInfo | None:
|
||||
"""Fetch long-term statistics from the HA recorder."""
|
||||
try:
|
||||
from homeassistant.components.recorder import ( # type: ignore[attr-defined]
|
||||
get_instance,
|
||||
)
|
||||
from homeassistant.components.recorder.statistics import (
|
||||
statistics_during_period,
|
||||
)
|
||||
from homeassistant.helpers.recorder import get_instance
|
||||
except ImportError:
|
||||
_LOGGER.debug("Recorder statistics module not available")
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user