Skip to content

Commit 98c7803

Browse files
committed
Battery (Android): fix battery temp detection
1 parent 0893013 commit 98c7803

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/detection/battery/battery_android.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ static const char* parseDumpsys(FFBatteryOptions* options, FFlist* results)
139139
if(options->temp)
140140
{
141141
if (ffParsePropLines(start, "temperature: ", &temp))
142+
{
142143
battery->temperature = ffStrbufToDouble(&temp, FF_BATTERY_TEMP_UNSET);
144+
if (battery->temperature != FF_BATTERY_TEMP_UNSET)
145+
battery->temperature /= 10.0; // Android returns temperature in tenths of a degree
146+
}
143147
ffStrbufClear(&temp);
144148
}
145149

0 commit comments

Comments
 (0)