diff --git a/esphome/components/network/util.cpp b/esphome/components/network/util.cpp index 12939f8f84..d29bf8e6bd 100644 --- a/esphome/components/network/util.cpp +++ b/esphome/components/network/util.cpp @@ -100,9 +100,7 @@ const std::string &get_use_address() { #endif #if !defined(USE_ETHERNET) && !defined(USE_MODEM) && !defined(USE_WIFI) - // Fallback when no network component is defined (shouldn't happen with USE_NETWORK defined) - static const std::string empty; - return empty; + static_assert(false, "At least one of USE_ETHERNET, USE_MODEM, or USE_WIFI must be defined when USE_NETWORK is set."); #endif }