Skip to content

Commit 73ff4e4

Browse files
TuxLux40Copilot
andcommitted
fix(cli/status): use descriptors() for device count in daemon mode
discovery.lcd_devices / led_devices are always empty through TrccProxy because live device objects don't travel over the wire. Both Trcc and TrccProxy expose lcd_descriptors() / led_descriptors() which do the right thing in both in-process and daemon-proxy mode. Fixes 'No devices connected.' in `trcc status` when daemon holds USB. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e49586c commit 73ff4e4

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/trcc/ui/cli/_status.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,12 @@ def status(json_output: bool = False) -> int:
8282
"""Print a full overview: app state + every connected device."""
8383
trcc = _boot_trcc()
8484
app_snap = trcc.control_center.snapshot()
85-
discovery = trcc.discover()
86-
lcd_snaps = [trcc.lcd.snapshot(i) for i in range(len(discovery.lcd_devices))]
87-
led_snaps = [trcc.led.snapshot(i) for i in range(len(discovery.led_devices))]
85+
trcc.discover()
86+
# Use descriptors (works in both in-process and daemon-proxy mode).
87+
# discovery.lcd_devices / led_devices are always empty via TrccProxy
88+
# because live device objects don't travel over the wire.
89+
lcd_snaps = [trcc.lcd.snapshot(i) for i in range(len(trcc.lcd_descriptors()))]
90+
led_snaps = [trcc.led.snapshot(i) for i in range(len(trcc.led_descriptors()))]
8891

8992
if json_output:
9093
return _echo_json({

0 commit comments

Comments
 (0)