Add life info for Crucial SATA SSDs

This commit is contained in:
Spiros
2024-06-03 19:06:11 +03:00
parent 7982a35f9d
commit 011bde2598

View File

@@ -281,7 +281,12 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal
if (!isNvme) {
for (const QJsonValue &attr : attributes) {
QJsonObject attrObj = attr.toObject();
if (attrObj["id"] == 241) {
if (attrObj["id"] == 202) {
if (attrObj["name"] == "Percent_Lifetime_Remain") {
int percentageUsed = 100 - attrObj["raw"].toObject()["value"].toInt();
percentage = QString::number(percentageUsed) + " %";
}
} else if (attrObj["id"] == 241) {
if (attrObj["name"] == "Total_Writes_GB") {
totalWrites = QString::number(attrObj["raw"].toObject()["value"].toInt()) + " GB";
} else if (attrObj["name"] == "Host_Writes_32MiB") {