Skip to content

Commit

Permalink
Fix "usage" key not returning data
Browse files Browse the repository at this point in the history
  • Loading branch information
kbickar committed Nov 7, 2024
1 parent 6cadfaa commit 5bf241e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sense_energy/sense_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def trend_start(self, scale: Scale) -> Optional[datetime]:
return None

def get_stat(self, scale: Scale, key: str) -> float:
key = "consumption" if key == "usage" else key
if scale not in self._trend_data or key not in self._trend_data[scale]:
return 0
data = self._trend_data[scale][key]
Expand Down

0 comments on commit 5bf241e

Please sign in to comment.