Fix USB device name matching and correct localization strings

This commit is contained in:
just_stuff_tm 2026-03-03 15:38:10 -05:00 committed by just-stuff-tm
parent 21ff765e41
commit 367e47bb1e
4 changed files with 20 additions and 13 deletions

View file

@ -235,7 +235,14 @@ class MeshcoreUsbFunctions(
}
private fun findUsbDevice(portName: String): UsbDevice? {
return usbManager.deviceList.values.firstOrNull { it.deviceName == portName }
val devices = usbManager.deviceList.values
val exactMatch = devices.firstOrNull { it.deviceName == portName }
if (exactMatch != null) {
return exactMatch
}
val normalizedName = portName.substringBefore(" - ").trim()
return devices.firstOrNull { it.deviceName == normalizedName }
}
private fun openUsbDevice(