diff --git a/CO2_Gadget_Menu.h b/CO2_Gadget_Menu.h index 3940c52e..73316e3c 100644 --- a/CO2_Gadget_Menu.h +++ b/CO2_Gadget_Menu.h @@ -1013,8 +1013,14 @@ void menuLoop() { return; } + if (activeWIFI) { + activeMQTTMenu[0].enable(); + } else { + activeMQTTMenu[0].disable(); + } + #if defined(SUPPORT_TFT) - if (wifiChanged) { + if ((wifiChanged) && (!inMenu)) { wifiChanged = false; tft.fillScreen(TFT_BLACK); } diff --git a/CO2_Gadget_WIFI.h b/CO2_Gadget_WIFI.h index 1b8ae63a..39a90e01 100644 --- a/CO2_Gadget_WIFI.h +++ b/CO2_Gadget_WIFI.h @@ -723,7 +723,7 @@ void wifiClientLoop() { // This is a workaround until I can directly determine whether the Wi-Fi data has been changed via BLE // Only checks for SSID changed (not password) - if (WiFi.SSID() != wifiSSID) { + if ((WiFi.SSID() != wifiSSID) && (!inMenu)) { Serial.println("-->[WiFi] Wi-Fi SSID changed. Old SSID: " + wifiSSID + ", new SSID: " + WiFi.SSID()); wifiSSID = WiFi.SSID(); putPreferences(); @@ -731,7 +731,7 @@ void wifiClientLoop() { wifiChanged = true; } - if (wifiChanged) { + if ((wifiChanged) && (!inMenu)) { wifiChanged = false; initWifi(); } diff --git a/platformio.ini b/platformio.ini index 45c22d42..47bb0d17 100644 --- a/platformio.ini +++ b/platformio.ini @@ -56,8 +56,8 @@ build_flags = '-DWIFI_PW_CREDENTIALS=""' -D MQTT_BROKER_SERVER="\"192.168.1.145"\" - -D CO2_GADGET_VERSION="\"0.8."\" - -D CO2_GADGET_REV="\"092-development"\" + -D CO2_GADGET_VERSION="\"0.9."\" + -D CO2_GADGET_REV="\"001-development"\" -D CORE_DEBUG_LEVEL=0 -DNEOPIXEL_PIN=26 ; Pinnumber for button for down/next and back / exit actions -DNEOPIXEL_COUNT=16 ; How many neopixels to control @@ -84,7 +84,7 @@ build_flags = -DMQTT_DISCOVERY_PREFIX="\"homeassistant/\"" -DESPNOW_PEER_MAC_ADDRESS="{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}" ; MAC Address of the ESP-NOW receiver (STA MAC). For unicast use peer address, as: {0xE8, 0x68, 0xE7, 0x0F, 0x08, 0x90} -DESPNOW_WIFI_CH=1 ; ESP-NOW WiFi Channel. Must be same as gateway - ; -DDEBUG_ARDUINOMENU + -DUEBUG_ARDUINOMENU ; -DMENU_DEBUG ; Needs streamFlow library -Os ; Optimize compilation for use memory -w ; Supress compilation warnings