walkingpad-controller 0.5.0__tar.gz → 0.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/PKG-INFO +1 -1
  2. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/pyproject.toml +1 -1
  3. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/src/walkingpad_controller/__init__.py +1 -1
  4. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/src/walkingpad_controller/const.py +6 -2
  5. walkingpad_controller-0.5.1/tests/test_protocol_detection.py +40 -0
  6. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/.gitignore +0 -0
  7. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/LICENSE +0 -0
  8. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/README.md +0 -0
  9. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/docs/ftms-protocol-reference.md +0 -0
  10. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/docs/ks-fit-reverse-engineering.md +0 -0
  11. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/docs/sperax-p3max-protocol.md +0 -0
  12. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/src/walkingpad_controller/controller.py +0 -0
  13. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/src/walkingpad_controller/ftms.py +0 -0
  14. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/src/walkingpad_controller/models.py +0 -0
  15. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/src/walkingpad_controller/sperax.py +0 -0
  16. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/src/walkingpad_controller/wilink.py +0 -0
  17. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/__init__.py +0 -0
  18. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/_common.py +0 -0
  19. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/test_connect.py +0 -0
  20. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/test_disconnect.py +0 -0
  21. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/test_observe.py +0 -0
  22. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/test_pause.py +0 -0
  23. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/test_reset.py +0 -0
  24. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/test_resume.py +0 -0
  25. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/test_set_inclination.py +0 -0
  26. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/test_set_speed.py +0 -0
  27. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/test_start.py +0 -0
  28. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/test_stop.py +0 -0
  29. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/test_switch_mode.py +0 -0
  30. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/commands/test_update_state.py +0 -0
  31. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/probe_disconnect.py +0 -0
  32. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/probe_keepalive.py +0 -0
  33. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/probe_lib_stability.py +0 -0
  34. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/probe_preworkout.py +0 -0
  35. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/probe_preworkout2.py +0 -0
  36. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/probe_setup_killer.py +0 -0
  37. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/probe_setup_step.py +0 -0
  38. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/stress_dynamic.py +0 -0
  39. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/stress_real_device.py +0 -0
  40. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/stress_start_stop.py +0 -0
  41. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/stress_traced.py +0 -0
  42. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/test_real_device.py +0 -0
  43. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/test_sperax_codec.py +0 -0
  44. {walkingpad_controller-0.5.0 → walkingpad_controller-0.5.1}/tests/watch_ble.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: walkingpad-controller
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Summary: Python library for controlling KingSmith WalkingPad treadmills over BLE (FTMS and legacy WiLink protocols)
5
5
  Project-URL: Homepage, https://github.com/mcdax/walkingpad-controller
6
6
  Project-URL: Repository, https://github.com/mcdax/walkingpad-controller
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "walkingpad-controller"
7
- version = "0.5.0"
7
+ version = "0.5.1"
8
8
  description = "Python library for controlling KingSmith WalkingPad treadmills over BLE (FTMS and legacy WiLink protocols)"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -36,7 +36,7 @@ from .models import DeviceCapabilities, SpeedRange, TreadmillStatus
36
36
  from .sperax import SperaxController
37
37
  from .wilink import WiLinkController
38
38
 
39
- __version__ = "0.5.0"
39
+ __version__ = "0.5.1"
40
40
 
41
41
  __all__ = [
42
42
  # Main controller
@@ -266,8 +266,12 @@ class TreadmillDataFlags:
266
266
  FTMS_NAME_PREFIXES = ("KS-HD-", "KS-MC21-", "KS-SMC21C-", "ZP-ZEALR1-")
267
267
 
268
268
  # BLE name prefixes for the Sperax / wi-linktech (WLT6200) vendor protocol.
269
- # The P3 Max advertises as "SPERAX_P3MAX".
270
- SPERAX_NAME_PREFIXES = ("SPERAX_",)
269
+ # The P3 Max advertises as "SPERAX_P3MAX". Keep this specific rather than a
270
+ # bare "SPERAX_" prefix: other Sperax-branded pads (e.g. the RM-01, which
271
+ # advertises as "SPERAX_RM-01_...") speak FTMS, not the WLT6200 vendor
272
+ # protocol. A too-broad prefix would misroute them to Sperax and break them;
273
+ # names that don't match here fall through to service-probe detection.
274
+ SPERAX_NAME_PREFIXES = ("SPERAX_P3MAX",)
271
275
 
272
276
  # Default connection parameters.
273
277
  # KingSmith FTMS firmware can be left in a bad state for several seconds
@@ -0,0 +1,40 @@
1
+ """Protocol detection from the BLE name.
2
+
3
+ Guards the name-prefix routing in particular: Sperax-branded pads that
4
+ actually speak FTMS (e.g. the RM-01) must NOT be routed to the Sperax
5
+ vendor protocol just because their name starts with "SPERAX_". Only the
6
+ P3 Max (SPERAX_P3MAX) uses the WLT6200 vendor protocol.
7
+ """
8
+
9
+ from types import SimpleNamespace
10
+
11
+ import pytest
12
+
13
+ from walkingpad_controller import ProtocolType, WalkingPadController
14
+
15
+
16
+ def _controller(name: str) -> WalkingPadController:
17
+ """Build a controller with a stub BLE device carrying the given name."""
18
+ ble_device = SimpleNamespace(name=name, address="AA:BB:CC:DD:EE:FF")
19
+ return WalkingPadController(ble_device=ble_device)
20
+
21
+
22
+ @pytest.mark.parametrize(
23
+ "ble_name, expected",
24
+ [
25
+ # FTMS families, matched by name prefix.
26
+ ("KS-HD-Z1D", ProtocolType.FTMS),
27
+ ("KS-MC21-D06BFD", ProtocolType.FTMS),
28
+ ("KS-SMC21C-XXXX", ProtocolType.FTMS),
29
+ ("ZP-ZEALR1-XXXX", ProtocolType.FTMS),
30
+ # The P3 Max is the only Sperax vendor-protocol device.
31
+ ("SPERAX_P3MAX", ProtocolType.SPERAX),
32
+ # Sperax-branded but FTMS: must fall through to service probing,
33
+ # so the name alone leaves the protocol UNKNOWN (resolved on connect).
34
+ ("SPERAX_RM-01_AB12CD", ProtocolType.UNKNOWN),
35
+ # WiLink / other names give no definitive answer from the name.
36
+ ("KS-ST-A1P", ProtocolType.UNKNOWN),
37
+ ],
38
+ )
39
+ def test_protocol_detected_from_name(ble_name: str, expected: ProtocolType) -> None:
40
+ assert _controller(ble_name).protocol == expected