Log temperature changes with resolution of one degree Celsius
This commit is contained in:
parent
b5ea060372
commit
78555ae3d2
1 changed files with 3 additions and 1 deletions
|
@ -182,9 +182,11 @@ void Battery::updateData()
|
||||||
if(temperatureFile && temperatureFile->open(QIODevice::ReadOnly)) {
|
if(temperatureFile && temperatureFile->open(QIODevice::ReadOnly)) {
|
||||||
nextTemperature = temperatureFile->readLine().trimmed().toInt();
|
nextTemperature = temperatureFile->readLine().trimmed().toInt();
|
||||||
if(nextTemperature != temperature) {
|
if(nextTemperature != temperature) {
|
||||||
|
if((nextTemperature / 10) != (temperature / 10)) {
|
||||||
|
logV(QString("Temperature: %1°C").arg(nextTemperature / 10));
|
||||||
|
}
|
||||||
temperature = nextTemperature;
|
temperature = nextTemperature;
|
||||||
emit temperatureChanged(temperature);
|
emit temperatureChanged(temperature);
|
||||||
logV(QString("Temperature: %1°C").arg(temperature / 10));
|
|
||||||
}
|
}
|
||||||
temperatureFile->close();
|
temperatureFile->close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue