Fix display 0 measurements on boot

This commit is contained in:
samuelbles07
2025-02-01 13:52:12 +07:00
parent 4534f7319a
commit 154f3ecf8a

View File

@ -268,15 +268,17 @@ void setup() {
oledDisplay.setBrightness(configuration.getDisplayBrightness()); oledDisplay.setBrightness(configuration.getDisplayBrightness());
} }
// Update display and led bar after finishing setup to show dashboard // Reset display and post schedulers to make sure measurements value already available
updateDisplayAndLedBar(); dispLedSchedule.update();
agApiPostSchedule.update();
} }
void loop() { void loop() {
/** Handle schedule */ /** Run schedulers */
dispLedSchedule.run(); dispLedSchedule.run();
configSchedule.run(); configSchedule.run();
agApiPostSchedule.run(); agApiPostSchedule.run();
watchdogFeedSchedule.run();
if (configuration.hasSensorS8) { if (configuration.hasSensorS8) {
co2Schedule.run(); co2Schedule.run();
@ -310,15 +312,13 @@ void loop() {
} }
} }
watchdogFeedSchedule.run();
/** Check for handle WiFi reconnect */ /** Check for handle WiFi reconnect */
wifiConnector.handle(); wifiConnector.handle();
/** factory reset handle */ /** factory reset handle */
factoryConfigReset(); factoryConfigReset();
/** check that local configura changed then do some action */ /** check that local configuration changed then do some action */
configUpdateHandle(); configUpdateHandle();
/** Firmware check for update handle */ /** Firmware check for update handle */