Guard SolarEdge for inverters without batteries (#40295)
This commit is contained in:
parent
75659ff787
commit
511ea09c99
1 changed files with 2 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue