Commit 88722b18 authored by David Redondo's avatar David Redondo 🏎 Committed by Nate Graham
Browse files

Fall back to power average if input is not available

Some power sensors don't expose a current value most notably amdgpu.
For those fall back to the average reading if available.
BUG:445920


(cherry picked from commit 7758d202)
parent 92fa5fc0
Pipeline #172667 passed with stage
in 1 minute and 18 seconds
......@@ -95,6 +95,9 @@ makeSensorsFeatureSensor(const QString &id, const sensors_chip_name *const chipN
break;
case SENSORS_FEATURE_POWER:
valueFeature = sensors_get_subfeature(chipName, feature, SENSORS_SUBFEATURE_POWER_INPUT);
if (!valueFeature) {
valueFeature = sensors_get_subfeature(chipName, feature, SENSORS_SUBFEATURE_POWER_AVERAGE);
}
unit = UnitWatt;
maximum = getValueOfFirstExisting({SENSORS_SUBFEATURE_POWER_CRIT, SENSORS_SUBFEATURE_POWER_MAX});
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment