mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-03 07:20:57 +10:00
Fix USB device name matching and correct localization strings
This commit is contained in:
committed by
just-stuff-tm
parent
21ff765e41
commit
367e47bb1e
@@ -235,7 +235,14 @@ class MeshcoreUsbFunctions(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun findUsbDevice(portName: String): UsbDevice? {
|
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(
|
private fun openUsbDevice(
|
||||||
|
|||||||
+4
-4
@@ -28,7 +28,7 @@
|
|||||||
"common_disable": "Disable",
|
"common_disable": "Disable",
|
||||||
"common_reboot": "Reboot",
|
"common_reboot": "Reboot",
|
||||||
"common_loading": "Loading...",
|
"common_loading": "Loading...",
|
||||||
"common_notAvailable": "—",
|
"common_notAvailable": "—",
|
||||||
"common_voltageValue": "{volts} V",
|
"common_voltageValue": "{volts} V",
|
||||||
"@common_voltageValue": {
|
"@common_voltageValue": {
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
@@ -1351,7 +1351,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"telemetry_temperatureValue": "{celsius}°C / {fahrenheit}°F",
|
"telemetry_temperatureValue": "{celsius}°C / {fahrenheit}°F",
|
||||||
"@telemetry_temperatureValue": {
|
"@telemetry_temperatureValue": {
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
"celsius": {
|
"celsius": {
|
||||||
@@ -1401,7 +1401,7 @@
|
|||||||
"channelPath_repeatsLabel": "Repeats",
|
"channelPath_repeatsLabel": "Repeats",
|
||||||
"channelPath_pathLabel": "Path {index}",
|
"channelPath_pathLabel": "Path {index}",
|
||||||
"channelPath_observedLabel": "Observed",
|
"channelPath_observedLabel": "Observed",
|
||||||
"channelPath_observedPathTitle": "Observed path {index} • {hops}",
|
"channelPath_observedPathTitle": "Observed path {index} • {hops}",
|
||||||
"@channelPath_observedPathTitle": {
|
"@channelPath_observedPathTitle": {
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
"index": {
|
"index": {
|
||||||
@@ -1476,7 +1476,7 @@
|
|||||||
},
|
},
|
||||||
"channelPath_pathLabelTitle": "Path",
|
"channelPath_pathLabelTitle": "Path",
|
||||||
"channelPath_observedPathHeader": "Observed Path",
|
"channelPath_observedPathHeader": "Observed Path",
|
||||||
"channelPath_selectedPathLabel": "{label} • {prefixes}",
|
"channelPath_selectedPathLabel": "{label} • {prefixes}",
|
||||||
"@channelPath_selectedPathLabel": {
|
"@channelPath_selectedPathLabel": {
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
"label": {
|
"label": {
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ abstract class AppLocalizations {
|
|||||||
/// No description provided for @common_notAvailable.
|
/// No description provided for @common_notAvailable.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
/// **'—'**
|
/// **'—'**
|
||||||
String get common_notAvailable;
|
String get common_notAvailable;
|
||||||
|
|
||||||
/// No description provided for @common_voltageValue.
|
/// No description provided for @common_voltageValue.
|
||||||
@@ -4409,7 +4409,7 @@ abstract class AppLocalizations {
|
|||||||
/// No description provided for @telemetry_temperatureValue.
|
/// No description provided for @telemetry_temperatureValue.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
/// **'{celsius}°C / {fahrenheit}°F'**
|
/// **'{celsius}°C / {fahrenheit}°F'**
|
||||||
String telemetry_temperatureValue(String celsius, String fahrenheit);
|
String telemetry_temperatureValue(String celsius, String fahrenheit);
|
||||||
|
|
||||||
/// No description provided for @neighbors_receivedData.
|
/// No description provided for @neighbors_receivedData.
|
||||||
@@ -4523,7 +4523,7 @@ abstract class AppLocalizations {
|
|||||||
/// No description provided for @channelPath_observedPathTitle.
|
/// No description provided for @channelPath_observedPathTitle.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
/// **'Observed path {index} • {hops}'**
|
/// **'Observed path {index} • {hops}'**
|
||||||
String channelPath_observedPathTitle(int index, String hops);
|
String channelPath_observedPathTitle(int index, String hops);
|
||||||
|
|
||||||
/// No description provided for @channelPath_noLocationData.
|
/// No description provided for @channelPath_noLocationData.
|
||||||
@@ -4607,7 +4607,7 @@ abstract class AppLocalizations {
|
|||||||
/// No description provided for @channelPath_selectedPathLabel.
|
/// No description provided for @channelPath_selectedPathLabel.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
/// **'{label} • {prefixes}'**
|
/// **'{label} • {prefixes}'**
|
||||||
String channelPath_selectedPathLabel(String label, String prefixes);
|
String channelPath_selectedPathLabel(String label, String prefixes);
|
||||||
|
|
||||||
/// No description provided for @channelPath_noHopDetailsAvailable.
|
/// No description provided for @channelPath_noHopDetailsAvailable.
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
String get common_loading => 'Loading...';
|
String get common_loading => 'Loading...';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get common_notAvailable => '—';
|
String get common_notAvailable => '—';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String common_voltageValue(String volts) {
|
String common_voltageValue(String volts) {
|
||||||
@@ -2465,7 +2465,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String telemetry_temperatureValue(String celsius, String fahrenheit) {
|
String telemetry_temperatureValue(String celsius, String fahrenheit) {
|
||||||
return '$celsius°C / $fahrenheit°F';
|
return '$celsius°C / $fahrenheit°F';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -2533,7 +2533,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String channelPath_observedPathTitle(int index, String hops) {
|
String channelPath_observedPathTitle(int index, String hops) {
|
||||||
return 'Observed path $index • $hops';
|
return 'Observed path $index • $hops';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -2588,7 +2588,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String channelPath_selectedPathLabel(String label, String prefixes) {
|
String channelPath_selectedPathLabel(String label, String prefixes) {
|
||||||
return '$label • $prefixes';
|
return '$label • $prefixes';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user