Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

add rounding to usage today sensor #31

Merged
merged 1 commit into from
Oct 30, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion custom_components/duke_energy_gateway/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "duke_energy_gateway",
"name": "Duke Energy Gateway",
"version": "0.1.0b3",
"version": "0.1.0b4",
"documentation": "https://github.com/mjmeli/ha-duke-energy-gateway",
"issue_tracker": "https://github.com/mjmeli/ha-duke-energy-gateway/issues",
"dependencies": [],
Expand Down
2 changes: 1 addition & 1 deletion custom_components/duke_energy_gateway/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def update(self):
"""Return today's usage by summing all measurements."""
gw_usage: list[UsageMeasurement] = self._coordinator.data
if gw_usage and len(gw_usage) > 0:
today_usage = sum(x.usage for x in gw_usage) / 1000
today_usage = round(sum(x.usage for x in gw_usage) / 1000, 5)
else:
today_usage = 0
self._state = today_usage
Expand Down