Correcting issue where sensor is not available and goes offline instead of reporting 0
This commit is contained in:
@@ -110,7 +110,10 @@ class FplDailyDeliveredKWHSensor(FplEntity):
|
||||
@property
|
||||
def state(self):
|
||||
data = self.getData("daily_usage")
|
||||
try:
|
||||
return data[-1]["netDeliveredKwh"]
|
||||
except:
|
||||
return 0
|
||||
|
||||
def defineAttributes(self):
|
||||
"""Return the state attributes."""
|
||||
|
||||
Reference in New Issue
Block a user