From 154f3ecf8a853ea95429343c155567d4c0435723 Mon Sep 17 00:00:00 2001 From: samuelbles07 Date: Sat, 1 Feb 2025 13:52:12 +0700 Subject: [PATCH] Fix display 0 measurements on boot --- examples/OneOpenAir/OneOpenAir.ino | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/OneOpenAir/OneOpenAir.ino b/examples/OneOpenAir/OneOpenAir.ino index ee4b680..9030ee8 100644 --- a/examples/OneOpenAir/OneOpenAir.ino +++ b/examples/OneOpenAir/OneOpenAir.ino @@ -268,15 +268,17 @@ void setup() { oledDisplay.setBrightness(configuration.getDisplayBrightness()); } - // Update display and led bar after finishing setup to show dashboard - updateDisplayAndLedBar(); + // Reset display and post schedulers to make sure measurements value already available + dispLedSchedule.update(); + agApiPostSchedule.update(); } void loop() { - /** Handle schedule */ + /** Run schedulers */ dispLedSchedule.run(); configSchedule.run(); agApiPostSchedule.run(); + watchdogFeedSchedule.run(); if (configuration.hasSensorS8) { co2Schedule.run(); @@ -310,15 +312,13 @@ void loop() { } } - watchdogFeedSchedule.run(); - /** Check for handle WiFi reconnect */ wifiConnector.handle(); /** factory reset handle */ factoryConfigReset(); - /** check that local configura changed then do some action */ + /** check that local configuration changed then do some action */ configUpdateHandle(); /** Firmware check for update handle */