From d9eb907edfa54671956a6919566d7f2bce598924 Mon Sep 17 00:00:00 2001 From: iranl Date: Wed, 19 Feb 2025 22:54:49 +0100 Subject: [PATCH] MDNS --- src/Config.h | 2 +- src/main.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Config.h b/src/Config.h index edbc838..220c9fe 100644 --- a/src/Config.h +++ b/src/Config.h @@ -5,7 +5,7 @@ #define NUKI_HUB_VERSION "9.09" #define NUKI_HUB_VERSION_INT (uint32_t)909 #define NUKI_HUB_BUILD "unknownbuildnr" -#define NUKI_HUB_DATE "2025-02-18" +#define NUKI_HUB_DATE "2025-02-19" #define GITHUB_LATEST_RELEASE_URL (char*)"https://github.com/technyon/nuki_hub/releases/latest" #define GITHUB_OTA_MANIFEST_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json" diff --git a/src/main.cpp b/src/main.cpp index 0c01222..c1d50b1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,6 +14,7 @@ #include "esp_core_dump.h" #include "FS.h" #include "SPIFFS.h" +#include #ifdef CONFIG_SOC_SPIRAM_SUPPORTED #include "esp_psram.h" #endif @@ -791,6 +792,10 @@ void setup() return response->redirect("/"); }); psychicSSLServer->begin(); + if (MDNS.begin(preferences->getString(preference_hostname, "nukihub").c_str())) { + MDNS.addService("http", "tcp", 443); + } + } } } @@ -807,6 +812,9 @@ void setup() return response->redirect("/"); }); psychicServer->begin(); + if (MDNS.begin(preferences->getString(preference_hostname, "nukihub").c_str())) { + MDNS.addService("http", "tcp", 80); + } #ifdef CONFIG_SOC_SPIRAM_SUPPORTED } #endif @@ -969,6 +977,9 @@ void setup() return response->redirect("/"); }); psychicSSLServer->begin(); + if (MDNS.begin(preferences->getString(preference_hostname, "nukihub").c_str())) { + MDNS.addService("http", "tcp", 443); + } } } } @@ -985,6 +996,9 @@ void setup() return response->redirect("/"); }); psychicServer->begin(); + if (MDNS.begin(preferences->getString(preference_hostname, "nukihub").c_str())) { + MDNS.addService("http", "tcp", 80); + } #ifdef CONFIG_SOC_SPIRAM_SUPPORTED } #endif