Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 4 additions & 2 deletions lib/history_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down