start including hourly data

This commit is contained in:
Yordan Suarez
2022-07-17 03:51:43 -04:00
parent dbfb88fb30
commit 53aaa4d3f5
4 changed files with 96 additions and 10 deletions

View File

@@ -23,7 +23,7 @@ class FplDailyUsageSensor(FplMoneyEntity):
"""Return the state attributes."""
data = self.getData("daily_usage")
attributes = {}
attributes["state_class"] = STATE_CLASS_TOTAL_INCREASING
# attributes["state_class"] = STATE_CLASS_TOTAL_INCREASING
if data is not None and len(data) > 0 and "readTime" in data[-1].keys():
attributes["date"] = data[-1]["readTime"]
@@ -52,9 +52,9 @@ class FplDailyUsageKWHSensor(FplEnergyEntity):
last_reset = date - timedelta(days=1)
attributes = {}
attributes["state_class"] = STATE_CLASS_TOTAL_INCREASING
# attributes["state_class"] = STATE_CLASS_TOTAL_INCREASING
attributes["date"] = date
attributes["last_reset"] = last_reset
# attributes["last_reset"] = last_reset
return attributes