diff --git a/esphome/components/network/ip_address.h b/esphome/components/network/ip_address.h index 03ba6e85d5..7bf09078be 100644 --- a/esphome/components/network/ip_address.h +++ b/esphome/components/network/ip_address.h @@ -36,7 +36,7 @@ struct IPAddress { IPAddress(const std::string &in_address) { ipaddr_aton(in_address.c_str(), &ip_addr_); } IPAddress(ip4_addr_t *other_ip) { memcpy((void *) &ip_addr_, (void *) other_ip, sizeof(ip4_addr_t)); -#if USE_ESP32 +#if USE_ESP32 && LWIP_IPV6 ip_addr_.type = IPADDR_TYPE_V4; #endif }