parent
6773c252d2
commit
97aa65d9a4
|
@ -489,7 +489,7 @@ async def async_validate(hass: HomeAssistant) -> EnergyPreferencesValidation:
|
||||||
|
|
||||||
# Fetch the needed statistics metadata
|
# Fetch the needed statistics metadata
|
||||||
statistics_metadata.update(
|
statistics_metadata.update(
|
||||||
await hass.async_add_executor_job(
|
await recorder.get_instance(hass).async_add_executor_job(
|
||||||
functools.partial(
|
functools.partial(
|
||||||
recorder.statistics.get_metadata,
|
recorder.statistics.get_metadata,
|
||||||
hass,
|
hass,
|
||||||
|
|
|
@ -260,7 +260,7 @@ async def ws_get_fossil_energy_consumption(
|
||||||
statistic_ids.append(msg["co2_statistic_id"])
|
statistic_ids.append(msg["co2_statistic_id"])
|
||||||
|
|
||||||
# Fetch energy + CO2 statistics
|
# 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,
|
recorder.statistics.statistics_during_period,
|
||||||
hass,
|
hass,
|
||||||
start_time,
|
start_time,
|
||||||
|
|
Loading…
Reference in New Issue