Added sanity check to clean up data

This commit is contained in:
Maximilian Giller 2024-05-07 00:04:31 +02:00
parent 4fb7c8b461
commit 35443b7cc8

View file

@ -153,8 +153,13 @@ async def log_bed_weights():
bl = r.get(f"{bett_ip}/sensor/bl/").json()["value"] bl = r.get(f"{bett_ip}/sensor/bl/").json()["value"]
br = r.get(f"{bett_ip}/sensor/br/").json()["value"] br = r.get(f"{bett_ip}/sensor/br/").json()["value"]
# Sanity check
if min([tl, tr, bl, br]) <= 0:
continue
add_weights_to_log(tl, tr, bl, br) add_weights_to_log(tl, tr, bl, br)
check_for_change() check_for_change()
except Exception as ex: except Exception as ex:
logging.exception(ex) logging.exception(ex)
await asyncio.sleep(1) finally:
await asyncio.sleep(1)