Skip to content

v0.22.6: bug-fix roundup (ntfy, HA API, Cheapest Fuel, deps)#203

Merged
dannymcc merged 5 commits into
mainfrom
dev
May 31, 2026
Merged

v0.22.6: bug-fix roundup (ntfy, HA API, Cheapest Fuel, deps)#203
dannymcc merged 5 commits into
mainfrom
dev

Conversation

@dannymcc

Copy link
Copy Markdown
Owner

Summary

Bundled bug-fix release combining four community contributions and a handful of dependency bumps.

Bug Fixes

  • ntfy (fix(ntfy): set User-Agent so Cloudflare doesn't 403 #202): notifications were getting blocked with HTTP 403 when ntfy sat behind Cloudflare Bot Fight Mode. Sending the same User-Agent: May-Vehicle-Manager/1.0 we already use for webhooks gets them through. Thanks to @GrueseGehenRaus for the diagnosis and patch.
  • Home Assistant API (Homeassistant.py references field v.unit_distance which does not exist for a vehicle #199 / fix for homeassistant api #200): the /api/ha/vehicles*, /api/ha/alerts and /api/ha/fuel/add endpoints referenced fields that don't exist on Vehicle (unit_distance, unit_volume, currency) and called MaintenanceSchedule.is_due() / Reminder.is_due() with the wrong signatures. Those endpoints have been broken since the model refactor. Now they read the units/currency off User, call is_due(current_odometer) / is_overdue() correctly, and add_fuel sets user_id so the insert no longer hits a NOT NULL violation. Four previously-xfailed tests now pass. Thanks to @vKnmnn for the fix and report.
  • Cheapest Fuel table (Cheapest Fuel table isssue #201): old or test fuel-price-history rows could be left behind in the Cheapest Fuel table with no way to remove them from the UI. Added a delete button on the per-station price-history page (only the owner can delete their own entry). Thanks to @stevemaunsell for staying on this one.

Dependency Updates

Test plan

  • Full suite passes locally (594 passed)
  • HA API tests no longer xfail
  • New tests cover the price-history delete route (auth, success, cross-user block)

dannymcc and others added 5 commits May 31, 2026 18:50
When ntfy is fronted by Cloudflare with Bot Fight Mode on, the default
Python-urllib agent gets blocked with HTTP 403. Use the same
May-Vehicle-Manager/1.0 UA the webhook sender already uses.

Co-authored-by: GrueseGehenRaus <noreply@github.com>
Closes #202
- Vehicle.unit_distance / unit_volume / currency don't exist; use the
  matching User fields (distance_unit, volume_unit, currency).
- MaintenanceSchedule.is_due() takes current_odometer; recompute
  overdue from date and odometer separately.
- Reminder.is_due() → is_overdue() (and surface upcoming reminders too).
- HA add_fuel now sets user_id on the FuelLog so the insert doesn't
  fail with a NOT NULL violation.
- Drop the xfail markers from tests that documented these bugs.

Co-authored-by: Robert von Könemann <robert@vonkoenemann.de>
Closes #199
Closes #200
- pillow >=12.2.0 (#193)
- weasyprint >=68.1 (#190)
- requests >=2.34.2 (#191)
- pytest-cov >=7.1.0 (#192)
- coverage >=7.14.0 (#189)
The Cheapest Fuel table reads from FuelPriceHistory. When a fuel log
was deleted in an older version, or when the matching row was orphaned
for any other reason, the entry kept appearing with no UI to remove it.

Add a delete button next to each row on a station's price-history page
(only the row's owner can delete it) so users can clear out stale or
test data without having to touch the database.
@dannymcc dannymcc merged commit e34c862 into main May 31, 2026
1 check passed
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.

2 participants