From a27b3feb987b6c86d3e05cb76e8e636d38b418a5 Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Fri, 3 Sep 2021 14:52:16 +0300 Subject: [PATCH] ota: port config and changelog --- CHANGELOG.md | 3 ++- code/espurna/ota_basicweb.cpp | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac6c2580..38a4a12f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -163,9 +163,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Refactor deprecated WiFiClientSecure ([#2140](https://github.com/xoseperez/espurna/issues/2140), [#2144](https://github.com/xoseperez/espurna/issues/2144)) #### WebUI - WebUI: alert when WS closes ([#2131](https://github.com/xoseperez/espurna/issues/2131), thanks to **[@foxman69](https://github.com/foxman69)**) -- Optional Web(UI) OTA ([#2190](https://github.com/xoseperez/espurna/issues/2190)) +- Optional Web(UI) OTA support ([#2190](https://github.com/xoseperez/espurna/issues/2190)) - Kingart curtain switch UI support ([#2250](https://github.com/xoseperez/espurna/issues/2250), thanks to **[@echauvet](https://github.com/echauvet)**) - Refactor WS implementation, add some comments to the header ([#2261](https://github.com/xoseperez/espurna/issues/2261)) +- Support Web(UI) OTA upgrades when the default web server is disabled [3ff460db](https://github.com/xoseperez/espurna/commit/3ff460db4af8e0b3df07ed04bb736941d47ca1ae) #### WiFi - Try to connect to a better AP, when the current RSSI is below -73dBm (only when WiFi scanning is enabled). [f0f7dcc8](https://github.com/xoseperez/espurna/commit/f0f7dcc874d6f6f4b095b6cb89e69cdb65219150), [dde5f374](https://github.com/xoseperez/espurna/commit/dde5f374dd038afe1fb966d31e16bdac1be581fb), [5a973298 (initial commit)](https://github.com/xoseperez/espurna/commit/5a97329832816219a919c4669e22ad6af0c8d228) - Allow to set bssid and channel, when scanning is disabled [c5f70286](https://github.com/xoseperez/espurna/commit/c5f70286d1e63972446c2148914352d9f6acf345) diff --git a/code/espurna/ota_basicweb.cpp b/code/espurna/ota_basicweb.cpp index 19536f48..e79b4a26 100644 --- a/code/espurna/ota_basicweb.cpp +++ b/code/espurna/ota_basicweb.cpp @@ -182,11 +182,20 @@ void setup(Server& server) { } } // namespace + +namespace settings { + +uint16_t port() { + constexpr uint16_t defaultPort { WEB_PORT }; + return getSetting("webPort", defaultPort); +} + +} // namespace settings } // namespace basic_web } // namespace ota void otaWebSetup() { - static ESP8266WebServer server(WEB_PORT); + static ESP8266WebServer server(ota::basic_web::settings::port()); ota::basic_web::setup(server); ::espurnaRegisterLoop([]() {