fix: correctly retrieve and display IP address for both IPv4 and IPv6 configurations

This commit is contained in:
2026-03-27 20:45:24 +01:00
parent 9de5236e65
commit 4cf5f6d151

View File

@@ -904,10 +904,22 @@ async fn try_connect_wifi_sntp_mqtt(
} else {
false
};
let ip = match stack.config_v4() {
Some(config) => config.address.address().to_string(),
None => {
match stack.config_v6() {
Some(config) => config.address.address().to_string(),
None => {
String::from("No IP")
}
}
},
};
NetworkMode::Wifi {
sntp: sntp_mode,
mqtt: mqtt_connected,
ip_address: stack.hardware_address().to_string(),
ip_address: ip,
}
}
Err(err) => {