mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 06:35:10 +02:00
This reverts commit ff84104f45
.
This commit is contained in:
@@ -5,7 +5,6 @@ from random import random
|
|||||||
|
|
||||||
from homeassistant import config_entries, setup
|
from homeassistant import config_entries, setup
|
||||||
from homeassistant.components import persistent_notification
|
from homeassistant.components import persistent_notification
|
||||||
from homeassistant.components.recorder import get_instance
|
|
||||||
from homeassistant.components.recorder.statistics import (
|
from homeassistant.components.recorder.statistics import (
|
||||||
async_add_external_statistics,
|
async_add_external_statistics,
|
||||||
get_last_statistics,
|
get_last_statistics,
|
||||||
@@ -246,7 +245,7 @@ async def _insert_statistics(hass):
|
|||||||
}
|
}
|
||||||
statistic_id = f"{DOMAIN}:energy_consumption"
|
statistic_id = f"{DOMAIN}:energy_consumption"
|
||||||
sum_ = 0
|
sum_ = 0
|
||||||
last_stats = await get_instance(hass).async_add_executor_job(
|
last_stats = await hass.async_add_executor_job(
|
||||||
get_last_statistics, hass, 1, statistic_id, True
|
get_last_statistics, hass, 1, statistic_id, True
|
||||||
)
|
)
|
||||||
if "domain:energy_consumption" in last_stats:
|
if "domain:energy_consumption" in last_stats:
|
||||||
|
Reference in New Issue
Block a user