mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix smappee component - "Error on device update" (#14883)
This commit is contained in:
commit
d6d685a483
@ -189,7 +189,9 @@ class SmappeeSensor(Entity):
|
|||||||
data = self._smappee.sensor_consumption[self._location_id]\
|
data = self._smappee.sensor_consumption[self._location_id]\
|
||||||
.get(int(sensor_id))
|
.get(int(sensor_id))
|
||||||
if data:
|
if data:
|
||||||
consumption = data.get('records')[-1]
|
tempdata = data.get('records')
|
||||||
|
if tempdata:
|
||||||
|
consumption = tempdata[-1]
|
||||||
_LOGGER.debug("%s (%s) %s",
|
_LOGGER.debug("%s (%s) %s",
|
||||||
sensor_name, sensor_id, consumption)
|
sensor_name, sensor_id, consumption)
|
||||||
value = consumption.get(self._smappe_name)
|
value = consumption.get(self._smappe_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user