mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix solaredge service data KeyError (#40653)
This commit is contained in:
parent
66a8edb11e
commit
b65583084b
@ -149,7 +149,7 @@ class SolarEdgeOverviewSensor(SolarEdgeSensor):
|
|||||||
def update(self):
|
def update(self):
|
||||||
"""Get the latest data from the sensor and update the state."""
|
"""Get the latest data from the sensor and update the state."""
|
||||||
self.data_service.update()
|
self.data_service.update()
|
||||||
self._state = self.data_service.data[self._json_key]
|
self._state = self.data_service.data.get(self._json_key)
|
||||||
|
|
||||||
|
|
||||||
class SolarEdgeDetailsSensor(SolarEdgeSensor):
|
class SolarEdgeDetailsSensor(SolarEdgeSensor):
|
||||||
@ -192,8 +192,8 @@ class SolarEdgeInventorySensor(SolarEdgeSensor):
|
|||||||
def update(self):
|
def update(self):
|
||||||
"""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()
|
||||||
self._state = self.data_service.data[self._json_key]
|
self._state = self.data_service.data.get(self._json_key)
|
||||||
self._attributes = self.data_service.attributes[self._json_key]
|
self._attributes = self.data_service.attributes.get(self._json_key)
|
||||||
|
|
||||||
|
|
||||||
class SolarEdgeEnergyDetailsSensor(SolarEdgeSensor):
|
class SolarEdgeEnergyDetailsSensor(SolarEdgeSensor):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user