bettwaage-sidequest #2
1 changed files with 2 additions and 4 deletions
|
@ -34,7 +34,7 @@ def get_clusters(data: list[float], min_delta: float) -> dict:
|
|||
clusters = {}
|
||||
for point in data:
|
||||
for known in clusters.keys():
|
||||
if math.abs(point - known) < min_delta:
|
||||
if math.fabs(point - known) < min_delta:
|
||||
clusters[known].append(point)
|
||||
continue
|
||||
clusters[point] = [point]
|
||||
|
@ -89,12 +89,10 @@ def check_for_change():
|
|||
|
||||
# Is triggered?
|
||||
delta = latest["total"] - local_history[-2]["total"]
|
||||
if math.abs(delta) < min_noticable_difference:
|
||||
logging.info(f"Delta: {delta}")
|
||||
if math.fabs(delta) < min_noticable_difference:
|
||||
return
|
||||
|
||||
# Changed weight up or down?
|
||||
logging.info(f"Delta: {delta}")
|
||||
weight_increased = delta > 0
|
||||
|
||||
# Make sure there is a bed_weight
|
||||
|
|
Loading…
Reference in a new issue