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,8 +189,10 @@ class SmappeeSensor(Entity):
|
||||
data = self._smappee.sensor_consumption[self._location_id]\
|
||||
.get(int(sensor_id))
|
||||
if data:
|
||||
consumption = data.get('records')[-1]
|
||||
_LOGGER.debug("%s (%s) %s",
|
||||
sensor_name, sensor_id, consumption)
|
||||
value = consumption.get(self._smappe_name)
|
||||
self._state = value
|
||||
tempdata = data.get('records');
|
||||
if tempdata:
|
||||
consumption = tempdata[-1]
|
||||
_LOGGER.debug("%s (%s) %s",
|
||||
sensor_name, sensor_id, consumption)
|
||||
value = consumption.get(self._smappe_name)
|
||||
self._state = value
|
||||
|
Loading…
x
Reference in New Issue
Block a user