Fixed Thethingsnetwork sensor issue so that it takes the most recent (last) item from the TTN data storage query result instead of the first. (#20790)
* Fixed Thethingsnetwork sensor issue so that it takes the most recent (last) item from the TTN data storage query result instead of the first. * Update sensor.py More pythonic way to get the last item of the sensor value list.pull/20951/head
parent
5df02f3a78
commit
203a6fd349
|
@ -153,7 +153,7 @@ class TtnDataStorage:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
data = await req.json()
|
data = await req.json()
|
||||||
self.data = data[0]
|
self.data = data[-1]
|
||||||
|
|
||||||
for value in self._values.items():
|
for value in self._values.items():
|
||||||
if value[0] not in self.data.keys():
|
if value[0] not in self.data.keys():
|
||||||
|
|
Loading…
Reference in New Issue