From 5099595aee8a55802149f3d8f37e04c8ed1adee3 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 10 May 2023 16:46:32 +1200 Subject: [PATCH] Wrap VA code (#4800) --- esphome/components/voice_assistant/voice_assistant.cpp | 4 ++++ esphome/components/voice_assistant/voice_assistant.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/esphome/components/voice_assistant/voice_assistant.cpp b/esphome/components/voice_assistant/voice_assistant.cpp index 4001779edd..fb96d484d4 100644 --- a/esphome/components/voice_assistant/voice_assistant.cpp +++ b/esphome/components/voice_assistant/voice_assistant.cpp @@ -1,5 +1,7 @@ #include "voice_assistant.h" +#ifdef USE_VOICE_ASSISTANT + #include "esphome/core/log.h" #include @@ -192,3 +194,5 @@ VoiceAssistant *global_voice_assistant = nullptr; // NOLINT(cppcoreguidelines-a } // namespace voice_assistant } // namespace esphome + +#endif // USE_VOICE_ASSISTANT diff --git a/esphome/components/voice_assistant/voice_assistant.h b/esphome/components/voice_assistant/voice_assistant.h index bcfdb75a75..c1a6e8883b 100644 --- a/esphome/components/voice_assistant/voice_assistant.h +++ b/esphome/components/voice_assistant/voice_assistant.h @@ -1,5 +1,9 @@ #pragma once +#include "esphome/core/defines.h" + +#ifdef USE_VOICE_ASSISTANT + #include "esphome/core/automation.h" #include "esphome/core/component.h" #include "esphome/core/defines.h" @@ -86,3 +90,5 @@ extern VoiceAssistant *global_voice_assistant; // NOLINT(cppcoreguidelines-avoi } // namespace voice_assistant } // namespace esphome + +#endif // USE_VOICE_ASSISTANT