Log temperature changes with resolution of one degree Celsius

This commit is contained in:
Matti Viljanen 2022-03-29 21:05:58 +03:00
parent b5ea060372
commit 78555ae3d2
No known key found for this signature in database
GPG key ID: CF32A1495158F888

View file

@ -182,9 +182,11 @@ void Battery::updateData()
if(temperatureFile && temperatureFile->open(QIODevice::ReadOnly)) {
nextTemperature = temperatureFile->readLine().trimmed().toInt();
if(nextTemperature != temperature) {
if((nextTemperature / 10) != (temperature / 10)) {
logV(QString("Temperature: %1°C").arg(nextTemperature / 10));
}
temperature = nextTemperature;
emit temperatureChanged(temperature);
logV(QString("Temperature: %1°C").arg(temperature / 10));
}
temperatureFile->close();
}