From d8a1277b79632908e6bed3b413de941cacb36ab2 Mon Sep 17 00:00:00 2001 From: Philipp Seelos Date: Fri, 6 Feb 2026 01:51:55 +0100 Subject: [PATCH 1/2] Fixed bug in correction alg. --- lib/history_correction.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/history_correction.py b/lib/history_correction.py index 876ca51..abe8609 100644 --- a/lib/history_correction.py +++ b/lib/history_correction.py @@ -94,11 +94,12 @@ def correct_value(db_file: str, name: str, new_eval, allow_negative_correction = continue prediction = predictions[0] + prefix_increased = i > 0 and int(correctedValue) > int(last_value[:i]) # Replace rotation class or denied digits with last value if prediction[0] == 'r' or denied_digits[i]: # check if the digit before has changed upwards, set the digit to 0 - if i > 0 and int(correctedValue[-1]) > int(last_value[i-1]): + if prefix_increased: chosen_digit = '0' else: chosen_digit = lastChar @@ -159,6 +160,7 @@ def correct_value(db_file: str, name: str, new_eval, allow_negative_correction = predictions = new_results[i] digit_appended = False + prefix_increased = i > 0 and int(correctedValue) > int(last_value[:i]) for prediction_index, prediction in enumerate(predictions): tempValue = correctedValue @@ -167,7 +169,7 @@ def correct_value(db_file: str, name: str, new_eval, allow_negative_correction = # replacement of the rotation class if prediction[0] == 'r' or denied_digits[i]: # check if the digit before has changed upwards, set the digit to 0 - if i > 0 and int(correctedValue[-1]) > int(last_value[i-1]): + if prefix_increased: chosen_digit = '0' tempConfidence *= prediction[1] else: From 4105fd15352b828c5158854c4190f4a722ede5db Mon Sep 17 00:00:00 2001 From: Philipp Seelos Date: Fri, 6 Feb 2026 01:52:13 +0100 Subject: [PATCH 2/2] Version bump --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 7b8fba2..be8e61b 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "name": "Meter Monitor", - "version": "3.3.0", + "version": "3.3.1", "image": "ghcr.io/phiph-s/metermonitor-managementserver", "slug": "meter_monitor", "description": "Integrate ESP32 based meter monitor cams with Home Assistant using AI",