1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-03 11:52:20 +01:00

Add MAC address to WiFi config reply (#6489)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
cvwillegen
2024-04-09 03:07:04 +02:00
committed by GitHub
parent efc9fd060d
commit 16d154e2e5
2 changed files with 97 additions and 95 deletions

View File

@@ -12,7 +12,7 @@ static const char *const TAG = "captive_portal";
void CaptivePortal::handle_config(AsyncWebServerRequest *request) {
AsyncResponseStream *stream = request->beginResponseStream("application/json");
stream->addHeader("cache-control", "public, max-age=0, must-revalidate");
stream->printf(R"({"name":"%s","aps":[{})", App.get_name().c_str());
stream->printf(R"({"mac":"%s","name":"%s","aps":[{})", get_mac_address_pretty().c_str(), App.get_name().c_str());
for (auto &scan : wifi::global_wifi_component->get_scan_result()) {
if (scan.get_is_hidden())