Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reverts the README changes introduced in #3, primarily removing/rewriting documentation around session startup and automatic reconnection behavior.
Changes:
- Replaces the “Starting a Session (Recommended)” section with a “Reconnecting” section and removes the
await client.start()example. - Removes the “Automatic Reconnection” documentation and updates disconnect messaging to imply manual reconnection.
- Simplifies the session lifecycle diagram by removing the automatic reconnection flow.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ```python | ||
| def on_disconnect(): | ||
| print("Connection lost — reconnecting automatically") | ||
| print("Connection lost — will need to reconnect") |
Comment on lines
311
to
319
| ### Session Lifecycle | ||
|
|
||
| ``` | ||
| DISCONNECTED → connect() → CONNECTED | ||
| → full_verify_pairing() → SESSION_ESTABLISHED (new device) | ||
| → quick_verify() → SESSION_ESTABLISHED (known device) | ||
| → init_button_events() (start receiving events) | ||
| → disconnect() → DISCONNECTED | ||
|
|
||
| Automatic reconnection (after unexpected disconnect): | ||
| DISCONNECTED → async_reconnect() ←─ backoff loop ──╮ | ||
| → _start_inner() → CONNECTED → SESSION_ESTABLISHED | ||
| │ (failure) ─────────────────────────────────────╯ | ||
| │ set_ble_device() wakes loop for immediate retry | ||
| → stop() → DISCONNECTED (loop exits) | ||
| ``` |
Comment on lines
+123
to
126
| ### Reconnecting (Subsequent Connections) | ||
|
|
||
| `start()` handles the full connection lifecycle in a single call: connect, quick verify, init button events, and read battery/firmware/name. | ||
| Quick verify uses stored pairing credentials for fast reconnection without user interaction. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reverts #3