From abd9ec221c6d13c9bc1a446a3e42657323bca2ac Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Mon, 6 May 2024 23:04:49 +0200 Subject: [PATCH] Fixed cluster call --- src/endpoints/handlers/bett.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/endpoints/handlers/bett.py b/src/endpoints/handlers/bett.py index 2fc5e23..203c4a1 100644 --- a/src/endpoints/handlers/bett.py +++ b/src/endpoints/handlers/bett.py @@ -98,7 +98,9 @@ def check_for_change(): # Make sure there is a bed_weight global empty_weight if empty_weight is None: - clusters = get_clusters([d["total"] for d in local_history]) + clusters = get_clusters( + [d["total"] for d in local_history], min_noticable_difference + ) empty_weight = min([median(cluster) for cluster in clusters.values()]) logging.info(f"Empty weight: {empty_weight}")