diff --git a/setup.cfg b/setup.cfg index 8f2d07a..48ee7d0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pyduke-energy -version = 0.0.14 +version = 0.0.15 author = Michael Meli author_email = mjmeli94@gmail.com description = Python Wrapper for unofficial Duke Energy REST API diff --git a/src/pyduke_energy/types.py b/src/pyduke_energy/types.py index d3d3384..e1b0f87 100644 --- a/src/pyduke_energy/types.py +++ b/src/pyduke_energy/types.py @@ -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