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

Commit

Permalink
Merge pull request #13 from mjmeli/fix-energy-reading-after-api-change
Browse files Browse the repository at this point in the history
change which value we read the hourly usage from - fixes #12
  • Loading branch information
mjmeli authored Dec 16, 2021
2 parents 8977705 + a243541 commit 799ae7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pyduke-energy
version = 0.0.14
version = 0.0.15
author = Michael Meli
author_email = [email protected]
description = Python Wrapper for unofficial Duke Energy REST API
Expand Down
3 changes: 2 additions & 1 deletion src/pyduke_energy/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ class UsageMeasurement:
def __init__(self, data: dict):
self.timestamp: int = int(data.get("t") / 1000) # remove ms
self.datetime_utc: datetime = utc_timestamp_to_datetime(self.timestamp)
self.usage: float = data.get("i") # i works for now
self.usage: float = data.get("dr") # dr is energy in Wh
self.power: float = data.get("i") # i is average power over the interval in W


@dataclass
Expand Down

0 comments on commit 799ae7e

Please sign in to comment.