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(

View file

@ -28,7 +28,7 @@
"common_disable": "Disable",
"common_reboot": "Reboot",
"common_loading": "Loading...",
"common_notAvailable": "—",
"common_notAvailable": "",
"common_voltageValue": "{volts} V",
"@common_voltageValue": {
"placeholders": {
@ -1351,7 +1351,7 @@
}
}
},
"telemetry_temperatureValue": "{celsius}°C / {fahrenheit}°F",
"telemetry_temperatureValue": "{celsius}°C / {fahrenheit}°F",
"@telemetry_temperatureValue": {
"placeholders": {
"celsius": {
@ -1401,7 +1401,7 @@
"channelPath_repeatsLabel": "Repeats",
"channelPath_pathLabel": "Path {index}",
"channelPath_observedLabel": "Observed",
"channelPath_observedPathTitle": "Observed path {index} • {hops}",
"channelPath_observedPathTitle": "Observed path {index} • {hops}",
"@channelPath_observedPathTitle": {
"placeholders": {
"index": {
@ -1476,7 +1476,7 @@
},
"channelPath_pathLabelTitle": "Path",
"channelPath_observedPathHeader": "Observed Path",
"channelPath_selectedPathLabel": "{label} • {prefixes}",
"channelPath_selectedPathLabel": "{label} • {prefixes}",
"@channelPath_selectedPathLabel": {
"placeholders": {
"label": {

View file

@ -295,7 +295,7 @@ abstract class AppLocalizations {
/// No description provided for @common_notAvailable.
///
/// In en, this message translates to:
/// **'—'**
/// **''**
String get common_notAvailable;
/// No description provided for @common_voltageValue.
@ -4409,7 +4409,7 @@ abstract class AppLocalizations {
/// No description provided for @telemetry_temperatureValue.
///
/// In en, this message translates to:
/// **'{celsius}°C / {fahrenheit}°F'**
/// **'{celsius}°C / {fahrenheit}°F'**
String telemetry_temperatureValue(String celsius, String fahrenheit);
/// No description provided for @neighbors_receivedData.
@ -4523,7 +4523,7 @@ abstract class AppLocalizations {
/// No description provided for @channelPath_observedPathTitle.
///
/// In en, this message translates to:
/// **'Observed path {index} • {hops}'**
/// **'Observed path {index} • {hops}'**
String channelPath_observedPathTitle(int index, String hops);
/// No description provided for @channelPath_noLocationData.
@ -4607,7 +4607,7 @@ abstract class AppLocalizations {
/// No description provided for @channelPath_selectedPathLabel.
///
/// In en, this message translates to:
/// **'{label} • {prefixes}'**
/// **'{label} • {prefixes}'**
String channelPath_selectedPathLabel(String label, String prefixes);
/// No description provided for @channelPath_noHopDetailsAvailable.

View file

@ -93,7 +93,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get common_loading => 'Loading...';
@override
String get common_notAvailable => '—';
String get common_notAvailable => '';
@override
String common_voltageValue(String volts) {
@ -2465,7 +2465,7 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String telemetry_temperatureValue(String celsius, String fahrenheit) {
return '$celsius°C / $fahrenheit°F';
return '$celsius°C / $fahrenheit°F';
}
@override
@ -2533,7 +2533,7 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String channelPath_observedPathTitle(int index, String hops) {
return 'Observed path $index • $hops';
return 'Observed path $index • $hops';
}
@override
@ -2588,7 +2588,7 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String channelPath_selectedPathLabel(String label, String prefixes) {
return '$label • $prefixes';
return '$label • $prefixes';
}
@override