Skip to content

Commit 028aa61

Browse files
committed
Now uses the view latest_node_readings so has knowledge of the friendly names
1 parent 12ea948 commit 028aa61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

feshiedb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def get_acceleromter_readings(self, node):
371371
def get_latest_node_readings(self):
372372
if self.db is None:
373373
raise FeshieDbError()
374-
self.db.query("SELECT device, MAX(timestamp) AS timestamp FROM `temperature_readings` WHERE timestamp <= NOW( ) AND device IN ( SELECT id FROM device_info WHERE type = \"Z1\") GROUP BY device ORDER BY timestamp DESC;")
374+
self.db.query("SELECT device, name, timestamp FROM latest_node_readings;")
375375
return self.db.store_result().fetch_row(0)
376376

377377
def get_adc_readings(self, node, adc):

0 commit comments

Comments
 (0)