mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Guard SolarEdge for inverters without batteries (#40295)
This commit is contained in:
parent
75659ff787
commit
511ea09c99
@ -267,6 +267,7 @@ class SolarEdgeStorageLevelSensor(SolarEdgeSensor):
|
|||||||
"""Get the latest inventory data and update state and attributes."""
|
"""Get the latest inventory data and update state and attributes."""
|
||||||
self.data_service.update()
|
self.data_service.update()
|
||||||
attr = self.data_service.attributes.get(self._json_key)
|
attr = self.data_service.attributes.get(self._json_key)
|
||||||
|
if attr and "soc" in attr:
|
||||||
self._state = attr["soc"]
|
self._state = attr["soc"]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user