mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Fix issue #14426: [homeassistant.components.sensor] smappee: Error on device update!
https://github.com/home-assistant/home-assistant/issues/14426
This commit is contained in:
parent
2da6d3c223
commit
61a41bb8fc
@ -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