walkingpad-controller 0.4.2__tar.gz → 0.4.4__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.
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/PKG-INFO +13 -7
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/README.md +12 -6
- walkingpad_controller-0.4.4/docs/ftms-protocol-reference.md +568 -0
- walkingpad_controller-0.4.4/docs/ks-fit-reverse-engineering.md +212 -0
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/pyproject.toml +1 -1
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/src/walkingpad_controller/const.py +117 -1
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/src/walkingpad_controller/controller.py +11 -0
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/src/walkingpad_controller/ftms.py +172 -41
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/src/walkingpad_controller/models.py +16 -0
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/tests/test_real_device.py +4 -0
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/.github/workflows/publish.yml +0 -0
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/.gitignore +0 -0
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/LICENSE +0 -0
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/src/walkingpad_controller/__init__.py +0 -0
- {walkingpad_controller-0.4.2 → walkingpad_controller-0.4.4}/src/walkingpad_controller/wilink.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: walkingpad-controller
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
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
|
|
42
|
+
- **KingSmith vendor extensions** — step counter (FTMS bit 13), MC-21 vendor pre-amble, supplement service detection
|
|
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
|
-
-
|
|
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
|
|
@@ -172,10 +175,13 @@ For advanced use, you can use the protocol controllers directly:
|
|
|
172
175
|
KingSmith FTMS devices require a `START_OR_RESUME` command before the belt will accept speed commands. The library handles this automatically: it sends START, waits for the belt to report speed > 0 via treadmill data notifications, then waits an additional stabilization period before sending `SET_TARGET_SPEED`. This avoids the BLE disconnects that occur when speed commands are sent too early during motor startup.
|
|
173
176
|
|
|
174
177
|
### BLE Connection Drops
|
|
175
|
-
KingSmith FTMS devices may occasionally drop the
|
|
178
|
+
KingSmith FTMS devices may occasionally drop the connection after a cold start. The library stores the pending target speed and re-applies it after reconnection.
|
|
176
179
|
|
|
177
180
|
### Connection Exclusivity
|
|
178
|
-
Only one BLE client can connect to the treadmill at a time
|
|
181
|
+
Only one BLE client can connect to the treadmill at a time — KS Fit and any client of this library are mutually exclusive.
|
|
182
|
+
|
|
183
|
+
### MC-21 Vendor Pre-amble
|
|
184
|
+
The MC-21 family (`KS-MC21-*`, `KS-SMC21C-*`, `ZP-ZEALR1-*`) requires a vendor pre-amble before each FTMS Control Point command, and acks via Fitness Machine Status events rather than Control Point indications. The library detects this and handles it transparently. See [docs/ftms-protocol-reference.md](docs/ftms-protocol-reference.md) for the protocol details and [docs/ks-fit-reverse-engineering.md](docs/ks-fit-reverse-engineering.md) for the analysis.
|
|
179
185
|
|
|
180
186
|
## Requirements
|
|
181
187
|
|
|
@@ -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
|
|
14
|
+
- **KingSmith vendor extensions** — step counter (FTMS bit 13), MC-21 vendor pre-amble, supplement service detection
|
|
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
|
-
-
|
|
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
|
|
@@ -144,10 +147,13 @@ For advanced use, you can use the protocol controllers directly:
|
|
|
144
147
|
KingSmith FTMS devices require a `START_OR_RESUME` command before the belt will accept speed commands. The library handles this automatically: it sends START, waits for the belt to report speed > 0 via treadmill data notifications, then waits an additional stabilization period before sending `SET_TARGET_SPEED`. This avoids the BLE disconnects that occur when speed commands are sent too early during motor startup.
|
|
145
148
|
|
|
146
149
|
### BLE Connection Drops
|
|
147
|
-
KingSmith FTMS devices may occasionally drop the
|
|
150
|
+
KingSmith FTMS devices may occasionally drop the connection after a cold start. The library stores the pending target speed and re-applies it after reconnection.
|
|
148
151
|
|
|
149
152
|
### Connection Exclusivity
|
|
150
|
-
Only one BLE client can connect to the treadmill at a time
|
|
153
|
+
Only one BLE client can connect to the treadmill at a time — KS Fit and any client of this library are mutually exclusive.
|
|
154
|
+
|
|
155
|
+
### MC-21 Vendor Pre-amble
|
|
156
|
+
The MC-21 family (`KS-MC21-*`, `KS-SMC21C-*`, `ZP-ZEALR1-*`) requires a vendor pre-amble before each FTMS Control Point command, and acks via Fitness Machine Status events rather than Control Point indications. The library detects this and handles it transparently. See [docs/ftms-protocol-reference.md](docs/ftms-protocol-reference.md) for the protocol details and [docs/ks-fit-reverse-engineering.md](docs/ks-fit-reverse-engineering.md) for the analysis.
|
|
151
157
|
|
|
152
158
|
## Requirements
|
|
153
159
|
|