Fixed cluster call

This commit is contained in:
Maximilian Giller 2024-05-06 23:04:49 +02:00
parent dc22afdfc8
commit abd9ec221c

View file

@ -98,7 +98,9 @@ def check_for_change():
# Make sure there is a bed_weight # Make sure there is a bed_weight
global empty_weight global empty_weight
if empty_weight is None: 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()]) empty_weight = min([median(cluster) for cluster in clusters.values()])
logging.info(f"Empty weight: {empty_weight}") logging.info(f"Empty weight: {empty_weight}")