add clean req

This commit is contained in:
Florian Bezannier
2021-05-10 20:53:53 +02:00
parent b7b8fe71c8
commit 335c8f79bf
+4 -1
View File
@@ -126,7 +126,10 @@ class Database:
def clean_battery(conn):
# delete charging longer than 17h
conn.execute("DElETE FROM battery WHERE JULIANDAY(stop_at)-JULIANDAY(start_at)>0.7;")
conn.execute("DELETE FROM battery WHERE start_level==end_level;")
# delete charging not finished longer than 17h
conn.execute("DELETE from battery where stop_at is NULL and JULIANDAY()-JULIANDAY(start_at)>0.7;")
#delete little charge
conn.execute("DELETE FROM battery WHERE start_level >= end_level-1;")
@staticmethod
def clean_position(conn):