walkingpad-controller 0.4.2__tar.gz → 0.4.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: walkingpad-controller
3
- Version: 0.4.2
3
+ Version: 0.4.3
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
@@ -35,11 +35,12 @@ Supports both **FTMS** (Fitness Machine Service) and legacy **WiLink** protocols
35
35
  ## Features
36
36
 
37
37
  - **Unified API** — single `WalkingPadController` class for all device types
38
- - **Auto protocol detection** — FTMS for newer KS-HD-* devices, WiLink for older models
38
+ - **Auto protocol detection** — FTMS for newer KS-HD-* / KS-MC21-* / KS-SMC21C-* / ZP-ZEALR1-* devices, WiLink for older models
39
39
  - **Real-time status** — speed, distance, duration, calories, steps via BLE notifications
40
40
  - **Cold-start handling** — waits for belt to start moving and stabilize before sending speed commands, avoiding BLE disconnects on KingSmith devices
41
41
  - **Reconnect recovery** — pending target speed is automatically re-applied after BLE reconnection
42
- - **KingSmith extensions** — step counter via proprietary FTMS extension (bit 13)
42
+ - **KingSmith extensions** — step counter via proprietary FTMS extension (bit 13), MC-21 vendor pre-amble for `SET_TARGET_SPEED`, supplement service detection (KS-HD-*)
43
+ - **Firmware version** — exposed via `controller.firmware_version` (FTMS only)
43
44
 
44
45
  ## Installation
45
46
 
@@ -120,6 +121,7 @@ The main entry point. Auto-detects protocol and delegates to the appropriate bac
120
121
  | `status` | Current `TreadmillStatus` |
121
122
  | `min_speed` / `max_speed` | Speed range in km/h (read from device for FTMS) |
122
123
  | `speed_increment` | Speed step size in km/h |
124
+ | `firmware_version` | Firmware version string (FTMS only; empty otherwise) |
123
125
  | `connect()` | Connect and auto-detect protocol |
124
126
  | `disconnect()` | Disconnect from the device |
125
127
  | `start()` | Start the belt (runs at minimum speed) |
@@ -158,8 +160,9 @@ For advanced use, you can use the protocol controllers directly:
158
160
  ## Supported Devices
159
161
 
160
162
  ### FTMS Protocol (tested)
161
- - KingSmith KS-Z1D (BLE name: `KS-HD-Z1D`)
162
- - Other KingSmith devices with BLE names starting with `KS-HD-`
163
+ - KingSmith KS-Z1D (BLE name: `KS-HD-Z1D`) — confirmed working
164
+ - KingSmith MC-21 (BLE names: `KS-MC21-*`, `KS-SMC21C-*`, `ZP-ZEALR1-*`) — confirmed working as of v0.4.1, requires the vendor pre-amble described below
165
+ - Other KingSmith devices with BLE names starting with `KS-HD-` are expected to work via the same FTMS / supplement-service code path
163
166
 
164
167
  ### WiLink Protocol (via ph4-walkingpad)
165
168
  - WalkingPad A1, A1 Pro
@@ -177,6 +180,11 @@ KingSmith FTMS devices may occasionally drop the BLE connection after a cold sta
177
180
  ### Connection Exclusivity
178
181
  Only one BLE client can connect to the treadmill at a time. If Home Assistant holds the connection, the KS Fit app cannot connect, and vice versa.
179
182
 
183
+ ### MC-21 Vendor Pre-amble
184
+ The KingSmith MC-21 family (`KS-MC21-*`, `KS-SMC21C-*`, `ZP-ZEALR1-*`) refuses standard FTMS `REQUEST_CONTROL` and rejects `SET_TARGET_SPEED` unless a fixed 8-byte payload is first written to a vendor characteristic (`d18d2c10-…`) embedded in the FTMS service. This library detects the characteristic on connect and replays the pre-amble before each Control Point command — matching what the official KS Fit app does. On these devices, command success is signalled via Fitness Machine Status (`0x2ADA`) events rather than Control Point indications; the library races both signals and accepts whichever arrives first.
185
+
186
+ For the full reverse-engineering analysis, see [docs/ftms-protocol-reference.md](docs/ftms-protocol-reference.md) and [docs/ks-fit-reverse-engineering.md](docs/ks-fit-reverse-engineering.md).
187
+
180
188
  ## Requirements
181
189
 
182
190
  - Python 3.10+
@@ -7,11 +7,12 @@ Supports both **FTMS** (Fitness Machine Service) and legacy **WiLink** protocols
7
7
  ## Features
8
8
 
9
9
  - **Unified API** — single `WalkingPadController` class for all device types
10
- - **Auto protocol detection** — FTMS for newer KS-HD-* devices, WiLink for older models
10
+ - **Auto protocol detection** — FTMS for newer KS-HD-* / KS-MC21-* / KS-SMC21C-* / ZP-ZEALR1-* devices, WiLink for older models
11
11
  - **Real-time status** — speed, distance, duration, calories, steps via BLE notifications
12
12
  - **Cold-start handling** — waits for belt to start moving and stabilize before sending speed commands, avoiding BLE disconnects on KingSmith devices
13
13
  - **Reconnect recovery** — pending target speed is automatically re-applied after BLE reconnection
14
- - **KingSmith extensions** — step counter via proprietary FTMS extension (bit 13)
14
+ - **KingSmith extensions** — step counter via proprietary FTMS extension (bit 13), MC-21 vendor pre-amble for `SET_TARGET_SPEED`, supplement service detection (KS-HD-*)
15
+ - **Firmware version** — exposed via `controller.firmware_version` (FTMS only)
15
16
 
16
17
  ## Installation
17
18
 
@@ -92,6 +93,7 @@ The main entry point. Auto-detects protocol and delegates to the appropriate bac
92
93
  | `status` | Current `TreadmillStatus` |
93
94
  | `min_speed` / `max_speed` | Speed range in km/h (read from device for FTMS) |
94
95
  | `speed_increment` | Speed step size in km/h |
96
+ | `firmware_version` | Firmware version string (FTMS only; empty otherwise) |
95
97
  | `connect()` | Connect and auto-detect protocol |
96
98
  | `disconnect()` | Disconnect from the device |
97
99
  | `start()` | Start the belt (runs at minimum speed) |
@@ -130,8 +132,9 @@ For advanced use, you can use the protocol controllers directly:
130
132
  ## Supported Devices
131
133
 
132
134
  ### FTMS Protocol (tested)
133
- - KingSmith KS-Z1D (BLE name: `KS-HD-Z1D`)
134
- - Other KingSmith devices with BLE names starting with `KS-HD-`
135
+ - KingSmith KS-Z1D (BLE name: `KS-HD-Z1D`) — confirmed working
136
+ - KingSmith MC-21 (BLE names: `KS-MC21-*`, `KS-SMC21C-*`, `ZP-ZEALR1-*`) — confirmed working as of v0.4.1, requires the vendor pre-amble described below
137
+ - Other KingSmith devices with BLE names starting with `KS-HD-` are expected to work via the same FTMS / supplement-service code path
135
138
 
136
139
  ### WiLink Protocol (via ph4-walkingpad)
137
140
  - WalkingPad A1, A1 Pro
@@ -149,6 +152,11 @@ KingSmith FTMS devices may occasionally drop the BLE connection after a cold sta
149
152
  ### Connection Exclusivity
150
153
  Only one BLE client can connect to the treadmill at a time. If Home Assistant holds the connection, the KS Fit app cannot connect, and vice versa.
151
154
 
155
+ ### MC-21 Vendor Pre-amble
156
+ The KingSmith MC-21 family (`KS-MC21-*`, `KS-SMC21C-*`, `ZP-ZEALR1-*`) refuses standard FTMS `REQUEST_CONTROL` and rejects `SET_TARGET_SPEED` unless a fixed 8-byte payload is first written to a vendor characteristic (`d18d2c10-…`) embedded in the FTMS service. This library detects the characteristic on connect and replays the pre-amble before each Control Point command — matching what the official KS Fit app does. On these devices, command success is signalled via Fitness Machine Status (`0x2ADA`) events rather than Control Point indications; the library races both signals and accepts whichever arrives first.
157
+
158
+ For the full reverse-engineering analysis, see [docs/ftms-protocol-reference.md](docs/ftms-protocol-reference.md) and [docs/ks-fit-reverse-engineering.md](docs/ks-fit-reverse-engineering.md).
159
+
152
160
  ## Requirements
153
161
 
154
162
  - Python 3.10+