diff --git a/esphome/components/ota/ota_backend.h b/esphome/components/ota/ota_backend.h index e474316bb5..5316411ba0 100644 --- a/esphome/components/ota/ota_backend.h +++ b/esphome/components/ota/ota_backend.h @@ -4,7 +4,9 @@ #include "esphome/core/defines.h" #include "esphome/core/helpers.h" +#ifdef USE_OTA_STATE_LISTENER #include +#endif namespace esphome { namespace ota {