Added sanity check to clean up data
This commit is contained in:
parent
4fb7c8b461
commit
35443b7cc8
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue