diff --git a/esphome/components/api/homeassistant_service.h b/esphome/components/api/homeassistant_service.h index bc7afadb49..d1eb7ffc29 100644 --- a/esphome/components/api/homeassistant_service.h +++ b/esphome/components/api/homeassistant_service.h @@ -7,7 +7,9 @@ #include #include #include "api_pb2.h" +#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES_JSON #include "esphome/components/json/json_util.h" +#endif #include "esphome/core/automation.h" #include "esphome/core/helpers.h"