DB config

This commit is contained in:
Manuel Weiser 2024-05-11 09:52:44 +02:00
parent 333475a826
commit 9622b90685

View File

@ -47,11 +47,11 @@ def updateLast(cursor):
cursor.execute(sql)
row = cursor.fetchone()
ins_id = row["id"]
ins_id = row[0]
## hole alle Fahrten nach letzter Ladung
sql = '''
SELECT * FROM bike_drives WHERE d_date >= 'row["l_date"]';
SELECT d_total_distance, d_total_ascent, d_avg_speed FROM bike_drives WHERE d_date >= 'row[1]';
'''
cursor.execute(sql)
rows = cursor.fetchall()
@ -63,9 +63,9 @@ def updateLast(cursor):
for row in rows:
fahrten += 1
total_range += row["d_total_distance"]
total_ascent += row["d_total_ascent"]
avg_speed += row["d_avg_speed"]
total_range += row[0]
total_ascent += row[1]
avg_speed += row[2]
avg_speed = round(avg_speed / fahrten, 1)