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