Only store valid sensor values
This commit is contained in:
parent
fc49f1d779
commit
348631fedc
@ -298,7 +298,9 @@ void MainWindow::updateState()
|
||||
|
||||
bool errorOccurred = false;
|
||||
for(auto& monitor: m_monitors) {
|
||||
monitor.brightness = monitor.manualOverride ? monitor.brightness : brightness;
|
||||
if(!std::isnan(brightness) && !monitor.manualOverride) {
|
||||
monitor.brightness = brightness;
|
||||
}
|
||||
if(!monitor.driver.setBrightness(monitor.brightness)) {
|
||||
errorOccurred = true;
|
||||
}
|
||||
@ -306,7 +308,7 @@ void MainWindow::updateState()
|
||||
return !errorOccurred;
|
||||
};
|
||||
|
||||
auto brightness = 0.5f;
|
||||
auto brightness = NAN;
|
||||
|
||||
if(!getAverageSensorValue(brightness)) {
|
||||
enumSensors();
|
||||
|
Loading…
Reference in New Issue
Block a user