mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-21 12:42:10 +02:00
Add MQTT
This commit is contained in:
@ -224,7 +224,7 @@ void StateMachine::co2Calibration(void) {
|
||||
|
||||
/** Count down to 0 then start */
|
||||
for (int i = 0; i < SENSOR_CO2_CALIB_COUNTDOWN_MAX; i++) {
|
||||
if (ag->isOne() || (ag->getBoardType() == DIY_PRO_INDOOR_V4_2)) {
|
||||
if (ag->isOne() || (ag->isPro4_2())) {
|
||||
String str =
|
||||
"after " + String(SENSOR_CO2_CALIB_COUNTDOWN_MAX - i) + " sec";
|
||||
disp.setText("Start CO2 calib", str.c_str(), "");
|
||||
@ -236,13 +236,13 @@ void StateMachine::co2Calibration(void) {
|
||||
}
|
||||
|
||||
if (ag->s8.setBaselineCalibration()) {
|
||||
if (ag->isOne() || (ag->getBoardType() == DIY_PRO_INDOOR_V4_2)) {
|
||||
if (ag->isOne() || (ag->isPro4_2())) {
|
||||
disp.setText("Calibration", "success", "");
|
||||
} else {
|
||||
logInfo("CO2 Calibration: success");
|
||||
}
|
||||
delay(1000);
|
||||
if (ag->isOne() || (ag->getBoardType() == DIY_PRO_INDOOR_V4_2)) {
|
||||
if (ag->isOne() || (ag->isPro4_2())) {
|
||||
disp.setText("Wait for", "calib finish", "...");
|
||||
} else {
|
||||
logInfo("CO2 Calibration: Wait for calibration finish...");
|
||||
@ -254,7 +254,7 @@ void StateMachine::co2Calibration(void) {
|
||||
delay(1000);
|
||||
count++;
|
||||
}
|
||||
if (ag->isOne() || (ag->getBoardType() == DIY_PRO_INDOOR_V4_2)) {
|
||||
if (ag->isOne() || (ag->isPro4_2())) {
|
||||
String str = "after " + String(count);
|
||||
disp.setText("Calib finish", str.c_str(), "sec");
|
||||
} else {
|
||||
@ -262,7 +262,7 @@ void StateMachine::co2Calibration(void) {
|
||||
}
|
||||
delay(2000);
|
||||
} else {
|
||||
if (ag->isOne() || (ag->getBoardType() == DIY_PRO_INDOOR_V4_2)) {
|
||||
if (ag->isOne() || (ag->isPro4_2())) {
|
||||
disp.setText("Calibration", "failure!!!", "");
|
||||
} else {
|
||||
logInfo("CO2 Calibration: failure!!!");
|
||||
@ -399,7 +399,7 @@ StateMachine::~StateMachine() {}
|
||||
*/
|
||||
void StateMachine::displayHandle(AgStateMachineState state) {
|
||||
// Ignore handle if not ONE_INDOOR board
|
||||
if (!(ag->isOne() || (ag->getBoardType() == DIY_PRO_INDOOR_V4_2))) {
|
||||
if (!(ag->isOne() || (ag->isPro4_2()))) {
|
||||
if (state == AgStateMachineCo2Calibration) {
|
||||
co2Calibration();
|
||||
}
|
||||
@ -527,11 +527,17 @@ void StateMachine::displayWiFiConnectCountDown(int count) {
|
||||
void StateMachine::ledAnimationInit(void) { ledBarAnimationCount = -1; }
|
||||
|
||||
/**
|
||||
* @brief Handle LED from state
|
||||
* @brief Handle LED from state, only handle LED if board type is: One Indoor or Open Air
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
void StateMachine::handleLeds(AgStateMachineState state) {
|
||||
/** Ignore if board type if not ONE_INDOOR or OPEN_AIR_OUTDOOR */
|
||||
if ((ag->getBoardType() != BoardType::ONE_INDOOR) &&
|
||||
(ag->getBoardType() != BoardType::OPEN_AIR_OUTDOOR)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (state > AgStateMachineNormal) {
|
||||
logError("ledHandle: state invalid");
|
||||
return;
|
||||
|
Reference in New Issue
Block a user