Skip to content

Port Bodytone GATT machine type detection#70

Open
michaelw wants to merge 20 commits into
dudanov:mainfrom
michaelw:mw/bodytone-gatt-machine-type
Open

Port Bodytone GATT machine type detection#70
michaelw wants to merge 20 commits into
dudanov:mainfrom
michaelw:mw/bodytone-gatt-machine-type

Conversation

@michaelw

@michaelw michaelw commented Jun 19, 2026

Copy link
Copy Markdown

Summary

  • port the GATT data-characteristic machine type detection idea from Add Bodytone DU30-B1D8 Fitness Bike #67
  • expose a reusable get_machine_type_from_gatt(...) helper
  • reuse the helper from the existing post-connect type correction path
  • add tests for each supported FTMS realtime data characteristic and the GATT-specific failure reason

Background

Thanks to #67 for the Bodytone DU30-B1D8 compatibility work and the successful discovery output. This port keeps that GATT data-characteristic detection idea, but layers it on top of the fork's existing UUID-only advertisement fallback and post-connect machine type correction.

Review notes addressed

This version keeps discovery from opening GATT connections inside the advertisement loop, so per-device connection delays and repeated fallback attempts cannot consume the scan window. It also keeps the existing scanner UUID filter behavior and raises a GATT-specific NotFitnessMachineError reason when no supported FTMS data characteristic is present.

The _cli disconnect guard and Python 3.14 support were already present in this fork.

Tests

  • uv run --project repos/python-pyftms ruff check repos/python-pyftms/src repos/python-pyftms/tests
  • uv run --project repos/python-pyftms pytest repos/python-pyftms/tests

michaelw and others added 20 commits March 23, 2026 19:29
* mw/kickr-core-v2:
  Handle repeated disconnect callbacks without _cli errors
  Implement TrainingStatusFlags and TrainingStatusCode handling for unknown and reserved values with logging
  Update Python version requirements to support 3.14
* mw/extended-status-strings:
  Handle extended training status strings
Bump the package version for the production fork release and point project metadata at the fork.

This release will be consumed by the forked Home Assistant FTMS integration via a tagged git dependency reference.
Zero-only realtime packets were previously treated as null packets. That dropped legitimate nonzero-to-zero transitions, which could leave Home Assistant sensors stuck on the last nonzero value.\n\nKeep suppressing likely bogus startup zero-only packets until the first nonzero realtime packet is seen, while still emitting real nonzero-to-zero transitions and deduplicating repeated zero packets.
* mw/zero-value-realtime-updates:
  Preserve real nonzero-to-zero realtime updates
* mw/uuid-only-ftms-fallback:
  Expose FTMS advertisement machine type detection
  feat: Support UUID-only FTMS devices with data-only fallback and post-connect type detection

# Conflicts:
#	src/pyftms/client/__init__.py
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