Conversation
#168 — `/api/calendar/feed` and the Home Assistant alerts route both referenced `MaintenanceSchedule.next_due_mileage`, which doesn't exist (the column is `next_due_odometer`). Calendar also called `vehicle.unit_distance` instead of `vehicle.get_effective_odometer_unit()`, so even after fixing the column the request would have failed for vehicles with a custom odometer unit. #169 — full-tank consumption only counted the volume of the current fill instead of summing every litre poured between the previous full tank and this one. With partial fills in between, the result was arbitrarily low (astrmn's case: 53.80 L over 1371 km reported as ~3.9 L/100km when the real fill-to-fill figure is 6.29 L/100km). `Vehicle.get_average_consumption` had the same shape of bug — only full-tank logs counted toward the total. Both now sum every fill in the range and bail out (return None) when any intervening log is flagged `is_missed`, so we don't show a confidently wrong number. - Bump APP_VERSION to 0.22.2 - New regression tests for the partial-fill and missed-fill cases
Astrmn's flow — log a fill-up first, create the station afterwards, then edit the log to attach the station — left both stats stale: the station's `times_used` counter never moved, and when the user *did* later swap the station on a log that already had one, the price-history row stayed pointed at the old station. The fix consolidates the price-history reconciliation in the edit handler: create + bump on first link, swap station_id + bump on a station change, delete on a price clear. Now the "cheapest fuel" list and "Used Nx" counter both reflect the current state of every log. - New regression test for the issue #170 scenario
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan