Skip to content
Snippets Groups Projects
Unverified Commit d6d685a4 authored by Aaron Bach's avatar Aaron Bach Committed by GitHub
Browse files

Fix smappee component - "Error on device update" (#14883)

parents 2c6e6c2a 5f65f67f
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment