Run energy db calls in the db executor (#69544)

Fixes #69537
This commit is contained in:
J. Nick Koston 2022-04-06 23:50:49 -10:00 committed by GitHub
parent 6773c252d2
commit 97aa65d9a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -489,7 +489,7 @@ async def async_validate(hass: HomeAssistant) -> EnergyPreferencesValidation:
# Fetch the needed statistics metadata
statistics_metadata.update(
await hass.async_add_executor_job(
await recorder.get_instance(hass).async_add_executor_job(
functools.partial(
recorder.statistics.get_metadata,
hass,