bettwaage-sidequest #2
1 changed files with 2 additions and 2 deletions
|
@ -129,11 +129,10 @@ def add_weights_to_log(tl: float, tr: float, bl: float, br: float):
|
||||||
|
|
||||||
global local_history
|
global local_history
|
||||||
local_history.append({"tl": tl, "tr": tr, "bl": bl, "br": br, "total": total})
|
local_history.append({"tl": tl, "tr": tr, "bl": bl, "br": br, "total": total})
|
||||||
if len(local_history):
|
if len(local_history) > history_max_length:
|
||||||
local_history = local_history[len(local_history) - history_max_length :]
|
local_history = local_history[len(local_history) - history_max_length :]
|
||||||
|
|
||||||
add_line_to_bed_history(f"{str(timestamp)};{tl};{tr};{bl};{br};{total};")
|
add_line_to_bed_history(f"{str(timestamp)};{tl};{tr};{bl};{br};{total};")
|
||||||
check_for_change()
|
|
||||||
|
|
||||||
|
|
||||||
async def log_bed_weights():
|
async def log_bed_weights():
|
||||||
|
@ -148,6 +147,7 @@ async def log_bed_weights():
|
||||||
bl = br
|
bl = br
|
||||||
|
|
||||||
add_weights_to_log(tl, tr, bl, br)
|
add_weights_to_log(tl, tr, bl, br)
|
||||||
|
check_for_change()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(1)
|
||||||
|
|
Loading…
Reference in a new issue