Skip to content

fix: restore B628 mph-to-km/h speed conversion in nautilusbike - #4839

Merged
cagnulein merged 1 commit into
masterfrom
fix/nautilusbike-b628-speed-mph-to-kmh
Jul 23, 2026
Merged

fix: restore B628 mph-to-km/h speed conversion in nautilusbike#4839
cagnulein merged 1 commit into
masterfrom
fix/nautilusbike-b628-speed-mph-to-kmh

Conversation

@cagnulein

Copy link
Copy Markdown
Owner

Summary

  • Commit 19ffdd6 ("B616 can be miles too") replaced if (!B616) with if (milesUnit) to support B616 bikes configured in miles mode
  • This broke B628 (and other non-B616 models) which always send speed in mph — without the conversion, QZ displays ~22 km/h instead of the correct ~36 km/h
  • The ratio between displayed and expected value is ~1.609 (exactly the mph→km/h factor), confirming the missing conversion

Fix: restore per-model logic in GetSpeedFromPacket:

  • B616: only convert when milesUnit is true (device sends km/h normally, mph when bike is in miles mode)
  • non-B616 (B628 etc.): always convert mph→km/h

Closes #4838

Test plan

  • B628 user with miles_unit = false: should now show ~36 km/h matching the bike console (was ~23 before)
  • B628 user with miles_unit = true: should show the correct mph value (~22.4 mph)
  • B616 user with miles_unit = false: unchanged — device sends km/h, no conversion applied
  • B616 user with miles_unit = true: unchanged — multiplies by 1.60934

🤖 Generated with Claude Code

Commit 19ffdd6 ("B616 can be miles too") replaced `if (!B616)` with
`if (milesUnit)` to support B616 bikes configured in miles mode, but
this broke the B628 (and similar non-B616 models) which always send
speed in mph and need the conversion regardless of the UI unit setting.

Restore per-model logic: non-B616 models always multiply by 1.60934,
while B616 only multiplies when the user has miles mode enabled.

Closes #4838

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cagnulein
cagnulein force-pushed the fix/nautilusbike-b628-speed-mph-to-kmh branch from 3f04d46 to 086ffcb Compare July 22, 2026 14:44
@cagnulein
cagnulein merged commit 302d193 into master Jul 23, 2026
28 checks passed
@cagnulein
cagnulein deleted the fix/nautilusbike-b628-speed-mph-to-kmh branch July 23, 2026 16:48
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.

[BUG] nautilus speed distance regression [mph VS kmh]

1 participant