DB config
This commit is contained in:
parent
a9785cc64c
commit
368b556a51
@ -61,6 +61,12 @@ def updateLast(db, cursor):
|
|||||||
fahrten = 0
|
fahrten = 0
|
||||||
|
|
||||||
print("Anzahl:", len(rows))
|
print("Anzahl:", len(rows))
|
||||||
|
if len(rows) < 1:
|
||||||
|
cursor.close()
|
||||||
|
if db:
|
||||||
|
db.close()
|
||||||
|
print("The SQLite connection is closed")
|
||||||
|
exit(0)
|
||||||
|
|
||||||
for row in rows:
|
for row in rows:
|
||||||
fahrten += 1
|
fahrten += 1
|
||||||
@ -70,11 +76,12 @@ def updateLast(db, cursor):
|
|||||||
|
|
||||||
avg_speed = round(avg_speed / fahrten, 1)
|
avg_speed = round(avg_speed / fahrten, 1)
|
||||||
|
|
||||||
data = (total_range, total_ascent, watt, fahrten, ins_id)
|
data = (total_range, total_ascent, avg_speed, watt, fahrten, ins_id)
|
||||||
sql = '''
|
sql = '''
|
||||||
UPDATE bike_loading SET
|
UPDATE bike_loading SET
|
||||||
l_total_range = ?,
|
l_total_range = ?,
|
||||||
l_total_ascent = ?,
|
l_total_ascent = ?,
|
||||||
|
l_avg_speed = ?,
|
||||||
l_loaded_wh = ?,
|
l_loaded_wh = ?,
|
||||||
l_fahrten = ?
|
l_fahrten = ?
|
||||||
WHERE id = ?
|
WHERE id = ?
|
||||||
|
Loading…
Reference in New Issue
Block a user