Skip to content

Commit 40c546d

Browse files
author
Marcus Terasa
committed
Ignore null values
1 parent 62f8888 commit 40c546d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

custom_components/foxess_api/fox_ess_cloud_api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import json
33
import time
44
from datetime import datetime
5-
65
from homeassistant.components.rest.data import RestData
76

87
from .const import BASE_URL, LOGGER, API_VERSION
@@ -180,7 +179,8 @@ async def update_report_data(self):
180179
variable = dataset["variable"]
181180
value_sum = 0.0
182181
for value in dataset["values"]:
183-
value_sum += float(value)
182+
if value is not None:
183+
value_sum += float(value)
184184
self.allData["report"][variable] = round(value_sum, 3)
185185
except KeyError:
186186
LOGGER.warning("Could not parse dataset data. If this error persists, check API for changes. "

0 commit comments

Comments
 (0)