Add proper naming for multi battery setup

This commit is contained in:
Turann_
2026-01-31 23:06:31 +03:00
parent b5e2e99282
commit 3cca35f3aa
+8 -1
View File
@@ -153,7 +153,14 @@ Singleton {
// Don't show name for laptop batteries
if (!isBluetoothDevice(device) && device.isLaptopBattery) {
return "";
// If there is more than one battery explicitly name them
Logger.e("BatteryDebug", "Available Battery count: " + laptopBatteries.length);
if (laptopBatteries.length > 1 && device.nativePath) {
// In case of 2 batteries: bat0 => bat1 bat1 => bat2
return I18n.tr("common.battery") + " " + parseInt(device.nativePath.substring(3) + 1);
}
// If only one battery no numbers needed.
return I18n.tr("common.battery");
}
if (isBluetoothDevice(device) && device.name) {