diff --git a/custom_components/fpl/fplapi.py b/custom_components/fpl/fplapi.py index 44b9810..040619f 100644 --- a/custom_components/fpl/fplapi.py +++ b/custom_components/fpl/fplapi.py @@ -205,6 +205,8 @@ class FplApi(object): r = (await response.json())["data"] dailyUsage = [] + totalPowerUsage = 0 + for daily in r["DailyUsage"]["data"]: if "kwhUsed" in daily.keys(): dailyUsage.append( @@ -215,8 +217,9 @@ class FplApi(object): "max_temperature": daily["averageHighTemperature"], } ) + totalPowerUsage += int(daily["kwhUsed"]) - return {"daily_usage": dailyUsage} + return {"total_power_usage": totalPowerUsage, "daily_usage": dailyUsage} return []