return none if no data is available

This commit is contained in:
Adam Outler
2021-12-30 15:34:18 -05:00
parent a3a59505bc
commit ba77a5e2c2
2 changed files with 13 additions and 7 deletions

View File

@@ -80,7 +80,7 @@ class FplDailyReceivedKWHSensor(FplEntity):
try:
return data[-1]["netReceivedKwh"]
except:
return 0
return None
def defineAttributes(self):
"""Return the state attributes."""
@@ -113,7 +113,7 @@ class FplDailyDeliveredKWHSensor(FplEntity):
try:
return data[-1]["netDeliveredKwh"]
except:
return 0
return None
def defineAttributes(self):
"""Return the state attributes."""