diff --git a/esphome/components/espnow/espnow.cpp b/esphome/components/espnow/espnow.cpp index d3c93ce5c0..d6fe536215 100644 --- a/esphome/components/espnow/espnow.cpp +++ b/esphome/components/espnow/espnow.cpp @@ -1,5 +1,7 @@ #include "espnow.h" +#if defined(USE_ESP32) + #include #include "esp_mac.h" @@ -388,3 +390,5 @@ ESPNowComponent *global_esp_now = nullptr; } // namespace espnow } // namespace esphome + +#endif diff --git a/esphome/components/espnow/espnow_packet.c b/esphome/components/espnow/espnow_packet.c index a8b5c77222..e9a185f16a 100644 --- a/esphome/components/espnow/espnow_packet.c +++ b/esphome/components/espnow/espnow_packet.c @@ -1,4 +1,5 @@ #include "espnow_packet.h" +#if defined(USE_ESP32) #include "esphome/core/log.h" @@ -43,3 +44,5 @@ bool ESPNowPacket::is_valid() { this->crc16 = crc; return valid; } + +#endif diff --git a/esphome/components/espnow/espnow_packet.h b/esphome/components/espnow/espnow_packet.h index 380a808370..cfa41b08af 100644 --- a/esphome/components/espnow/espnow_packet.h +++ b/esphome/components/espnow/espnow_packet.h @@ -1,6 +1,6 @@ #pragma once -// #if defined(USE_ESP32) +#if defined(USE_ESP32) #include "esphome/core/automation.h" #include "esphome/core/component.h" @@ -100,3 +100,5 @@ struct ESPNowPacket { } // namespace espnow } // namespace esphome + +#endif