Allow setup to continue past mqtt if network/wifi is disabled (#5754)

This commit is contained in:
Jesse Hills
2023-11-15 10:51:45 +13:00
committed by GitHub
parent ae0e481cff
commit 2754ddec1b
3 changed files with 11 additions and 1 deletions
+8
View File
@@ -29,6 +29,14 @@ bool is_connected() {
return false;
}
bool is_disabled() {
#ifdef USE_WIFI
if (wifi::global_wifi_component != nullptr)
return wifi::global_wifi_component->is_disabled();
#endif
return false;
}
network::IPAddress get_ip_address() {
#ifdef USE_ETHERNET
if (ethernet::global_eth_component != nullptr)
+2
View File
@@ -8,6 +8,8 @@ namespace network {
/// Return whether the node is connected to the network (through wifi, eth, ...)
bool is_connected();
/// Return whether the network is disabled (only wifi for now)
bool is_disabled();
/// Get the active network hostname
std::string get_use_address();
IPAddress get_ip_address();