Devices: fixes from review round 17

- A command that fails after a switch doesn't make the connector drop the new
  headset's connection.
- On first import, the app keeps using the `frame` headset even when Set Up
  Connection put another block above it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
saphidandClaude Opus 5.5 committed 2026-09-29 00:08:36 +10:00
1 parent fa05a4b310
commit 90fd2684ba
5 files changed
+35 -3

No files matched your search

+6 -2
View File
@@ -325,8 +325,12 @@ class Link:
def route_key(device):
return device["id"], device.get("user"), device.get("port"), tuple(device.get("frozen") or ())
def lost(self, message):
"""A command couldn't reach the headset (Windows has no master to watch)."""
def lost(self, message, gen=None):
"""A command couldn't reach the headset (Windows has no master to watch). `gen`:
the route it was sent on; one to a headset since switched away from says nothing
about this one."""
if gen is not None and gen != self.gen:
return
if self.state["phase"] == "connected":
self.kick(f"lost: {message}")