1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 17:49:37 +01:00

Guard SolarEdge for inverters without batteries (#40295)

This commit is contained in:
Markus Haack
2020-09-23 04:04:01 +02:00
committed by GitHub
parent 75659ff787
commit 511ea09c99
+2 -1
View File
@@ -267,7 +267,8 @@ class SolarEdgeStorageLevelSensor(SolarEdgeSensor):
"""Get the latest inventory data and update state and attributes."""
self.data_service.update()
attr = self.data_service.attributes.get(self._json_key)
self._state = attr["soc"]
if attr and "soc" in attr:
self._state = attr["soc"]
class SolarEdgeDataService: