Skip to content

fix: separate consumption by fuel type - #320

Draft
gwenvador wants to merge 1 commit into
dannymcc:devfrom
gwenvador:codex/fix-adblue-consumption
Draft

fix: separate consumption by fuel type#320
gwenvador wants to merge 1 commit into
dannymcc:devfrom
gwenvador:codex/fix-adblue-consumption

Conversation

@gwenvador

Copy link
Copy Markdown

Summary

  • separate full-to-full consumption calculations by effective fuel type
  • keep primary-fuel averages independent from secondary fuels and auxiliary fluids such as AdBlue
  • treat legacy NULL fuel-type rows as the vehicle primary fuel
  • add AdBlue to the available fuel types
  • show the effective fuel type in the Fuel Logs table
  • render separate labelled consumption-trend series for Diesel, AdBlue, and other fuel types

Why

A secondary AdBlue refill could become the previous full-tank anchor, be included in diesel volume, and appear in the same Fuel Consumption Trend series. This produced incorrect diesel L/100 km values.

Fixes #319.
Related to #221.

Testing

  • Added regression coverage ensuring a full AdBlue entry does not affect diesel full-to-full consumption.
  • Added coverage for independent primary and secondary-fluid averages.
  • Added coverage for legacy NULL fuel-type rows inheriting the primary vehicle fuel.
  • python -m pytest tests/test_fuel.py tests/test_api.py -q — 90 tests passed in the project Docker environment.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant