mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-15 08:56:34 +02:00
Add condition to handle configuration changed.
This commit is contained in:
@ -795,9 +795,11 @@ static void configUpdateHandle() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ag->isOne()) {
|
||||
ledBarEnabledUpdate();
|
||||
stateMachine.executeCo2Calibration();
|
||||
stateMachine.executeLedBarTest();
|
||||
}
|
||||
stateMachine.executeCo2Calibration();
|
||||
|
||||
String mqttUri = configuration.getMqttBrokerUri();
|
||||
if (mqttClient.isCurrentUri(mqttUri) == false) {
|
||||
@ -805,6 +807,7 @@ static void configUpdateHandle() {
|
||||
initMqtt();
|
||||
}
|
||||
|
||||
if (configuration.hasSensorSGP) {
|
||||
if (configuration.noxLearnOffsetChanged() ||
|
||||
configuration.tvocLearnOffsetChanged()) {
|
||||
ag->sgp41.end();
|
||||
@ -827,7 +830,9 @@ static void configUpdateHandle() {
|
||||
resultStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ag->isOne()) {
|
||||
if (configuration.isLedBarBrightnessChanged()) {
|
||||
ag->ledBar.setBrighness(configuration.getLedBarBrightness());
|
||||
Serial.println("Set 'LedBarBrightness' brightness: " +
|
||||
@ -838,6 +843,7 @@ static void configUpdateHandle() {
|
||||
Serial.println("Set 'DisplayBrightness' brightness: " +
|
||||
String(configuration.getDisplayBrightness()));
|
||||
}
|
||||
}
|
||||
|
||||
fwNewVersion = configuration.newFirmwareVersion();
|
||||
if (fwNewVersion.length()) {
|
||||
|
@ -394,6 +394,9 @@ StateMachine::~StateMachine() {}
|
||||
void StateMachine::displayHandle(AgStateMachineState state) {
|
||||
// Ignore handle if not ONE_INDOOR board
|
||||
if (!ag->isOne()) {
|
||||
if (state == AgStateMachineCo2Calibration) {
|
||||
co2Calibration();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user