kobo nia c support

This commit is contained in:
Szybet 2023-07-24 20:05:22 +02:00 committed by Nicolas Mailloux
parent 96a95de9e1
commit 8a3f18d703

View file

@ -443,6 +443,15 @@ namespace {
batteryLevelInt = batteryLevel.toInt(); batteryLevelInt = batteryLevel.toInt();
batteryLevel.append("%"); batteryLevel.append("%");
} }
else {
// It's for the Nia model c - but also its a more regular - default path, so make it the fallback
QString path = "/sys/class/power_supply/battery/capacity";
if(QFile::exists(path)) {
batteryLevel = readFile(path).trimmed();
batteryLevelInt = batteryLevel.toInt();
batteryLevel.append("%");
}
}
} }
} }
void writeconfig(std::string file, std::string config) { void writeconfig(std::string file, std::string config) {