Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unit of measurement from new const #177

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions custom_components/tauron_amiplus/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from homeassistant.components.recorder.models import StatisticMetaData
from homeassistant.components.recorder.statistics import (async_add_external_statistics, get_last_statistics,
statistics_during_period)
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, ENERGY_KILO_WATT_HOUR
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, UnitOfEnergy
from homeassistant.core import HomeAssistant
from homeassistant.util.dt import as_utc, get_time_zone, utc_from_timestamp

Expand Down Expand Up @@ -215,7 +215,7 @@ async def update_stats(self, statistic_id, statistic_name, initial_sum, last_sta
"name": statistic_name,
"source": STATISTICS_DOMAIN,
"statistic_id": statistic_id,
"unit_of_measurement": ENERGY_KILO_WATT_HOUR
"unit_of_measurement": UnitOfEnergy.KILO_WATT_HOUR
}
statistic_data = []
for raw_hour in raw_data:
Expand Down
Loading