Support FTMS devices without service_data (data‑only fallback + detect type after connect) #49
+88
−7
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.
Hi! I ran into this on a budget SLUNSE Exercise Bike I bought on Amazon. It advertises the FTMS service UUID (0x1826) but doesn’t include the FTMS service_data in the advertisement. Because of that, pyftms rejected it with NotFitnessMachineError even though, after connecting, the device does expose the FTMS data stream and sends notifications.
Context: I discovered this while trying to integrate the bike into Home Assistant using the FTMS custom component.
This PR lets pyftms still connect and read data in that situation.
I’m not sure how common this pattern is across other devices. I tried to keep the change as generic and low‑risk as possible so it can help similar cases without impacting fully compliant devices.
What I changed:
Is the placeholder approach okay? It gets corrected right after connect.
I’m not sure this is the best way to solve it; very open to advice, critique, or alternative approaches.
I haven't tested if this fixes the Home Assistant component yet.
Happy to provide any further information or debugging if needed to make a better fix.