mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
parent
6773c252d2
commit
97aa65d9a4
@ -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,
|
||||
|
@ -260,7 +260,7 @@ async def ws_get_fossil_energy_consumption(
|
||||
statistic_ids.append(msg["co2_statistic_id"])
|
||||
|
||||
# Fetch energy + CO2 statistics
|
||||
statistics = await hass.async_add_executor_job(
|
||||
statistics = await recorder.get_instance(hass).async_add_executor_job(
|
||||
recorder.statistics.statistics_during_period,
|
||||
hass,
|
||||
start_time,
|
||||
|
Loading…
x
Reference in New Issue
Block a user