Skip to content

Revert "Fix reconnect loop and update README"#5

Open
alhia wants to merge 1 commit intomainfrom
revert-3-refactor/bind-transport-and-release-workflow
Open

Revert "Fix reconnect loop and update README"#5
alhia wants to merge 1 commit intomainfrom
revert-3-refactor/bind-transport-and-release-workflow

Conversation

@alhia
Copy link
Collaborator

@alhia alhia commented Mar 17, 2026

Reverts #3

Copilot AI review requested due to automatic review settings March 17, 2026 12:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants