diff --git a/library.json b/library.json index 3093672..2ad9796 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "og3x-oled", - "version": "0.2.2", + "version": "0.2.3", "description": "Add support for SSD1306 OLED to chl33/og3", "keywords": "esp32, esp8266, oled", "authors": [ @@ -12,7 +12,7 @@ } ], "dependencies": { - "chl33/og3": "~0.2.2", + "chl33/og3": "~0.2.3", "thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays": "~4.2.0" }, "export": { diff --git a/src/oled_wifi_info.cpp b/src/oled_wifi_info.cpp index 8b983b2..86425ec 100644 --- a/src/oled_wifi_info.cpp +++ b/src/oled_wifi_info.cpp @@ -23,8 +23,14 @@ OledWifiInfo::OledWifiInfo(Tasks* tasks) : Module(OledWifiInfo::kName, tasks->mo m_oled->addDisplayFn([this]() { if (m_wifi->apMode()) { char buf[80]; - snprintf(buf, sizeof(buf), "AP: %s", m_wifi->board().c_str()); + static bool s_show_password = false; + if (s_show_password && m_wifi->ap_password()) { + snprintf(buf, sizeof(buf), "PW: %s", m_wifi->ap_password()); + } else { + snprintf(buf, sizeof(buf), "AP: %s", m_wifi->board().c_str()); + } m_oled->display(buf); + s_show_password = !s_show_password; } else if (m_wifi->wasConnected()) { char buf[80]; snprintf(buf, sizeof(buf), "IP: %s", m_wifi->ipAddress().c_str());