What
The USB power-save feature (v1.5.x) discovers one Dymo printer's USB hub/port by matching vendor:product ID (0922:1002) and powers that port on/off via `uhubctl`. For setups with two or more DYMOs plugged into the same Pi, this breaks down — there's no way to know which port belongs to which printer, so the feature can only manage the first one it finds.
Why
- Real multi-printer deployments exist (the multi-printer UI selector has been in place since v1.4).
- Without per-printer mapping, the power-save daemon would either power off all DYMOs together (bad) or pick one arbitrarily (also bad).
- No demand reported yet, but the limitation is in the comments at `server/usb_power.py` and should be tracked here too.
Implementation sketch
- Extend the persisted USB power state (currently a single hub/port pair) to a map keyed by `PrinterInfo.id` — same id used everywhere else for printer routing.
- On discovery (`uhubctl` scan + `DeviceManager`), match each Dymo by its USB bus/address (which is what the device manager already gives us in the ID) rather than vendor:product alone. Store the resulting hub/port under that printer's id.
- Manual `/api/power/{status,on,off}` endpoints take a `printer_id` query param (default = currently-selected / first found, to keep the single-printer case unchanged).
- Auto-idle: each printer's idle timer is independent; activity to one printer doesn't keep the others awake.
Where in the code
- `server/usb_power.py` — discovery + state. The "TODO: per-printer port mapping" comment is already there as a marker.
- `server/app.py` — `/api/power/*` endpoints need an optional id arg.
- `server/power_save.py` — idle timer would become per-printer-id.
- Client: `PowerToggle` component could show one toggle per printer (or just the currently-selected one).
Out of scope
- Discovering hubs that don't support per-port power switching (ppps). Those printers simply opt out of the feature; that's already the case.
- Mixed virtual + real setups — virtual printers don't have power state.
Pin this if a multi-printer user actually runs into it.
What
The USB power-save feature (v1.5.x) discovers one Dymo printer's USB hub/port by matching vendor:product ID (
0922:1002) and powers that port on/off via `uhubctl`. For setups with two or more DYMOs plugged into the same Pi, this breaks down — there's no way to know which port belongs to which printer, so the feature can only manage the first one it finds.Why
Implementation sketch
Where in the code
Out of scope
Pin this if a multi-printer user actually runs into it.