From 5bf241efe15945dba5f15b6a28bac2d9775c13b7 Mon Sep 17 00:00:00 2001 From: Keilin Date: Wed, 6 Nov 2024 20:11:54 -0500 Subject: [PATCH] Fix "usage" key not returning data --- sense_energy/sense_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sense_energy/sense_api.py b/sense_energy/sense_api.py index 901e621..6a766d3 100644 --- a/sense_energy/sense_api.py +++ b/sense_energy/sense_api.py @@ -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]