mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-07 05:13:31 +02:00
Add 'voice_assistant.connected' condition (#5845)
This commit is contained in:
@@ -222,6 +222,11 @@ template<typename... Ts> class IsRunningCondition : public Condition<Ts...>, pub
|
||||
bool check(Ts... x) override { return this->parent_->is_running() || this->parent_->is_continuous(); }
|
||||
};
|
||||
|
||||
template<typename... Ts> class ConnectedCondition : public Condition<Ts...>, public Parented<VoiceAssistant> {
|
||||
public:
|
||||
bool check(Ts... x) override { return this->parent_->get_api_connection() != nullptr; }
|
||||
};
|
||||
|
||||
extern VoiceAssistant *global_voice_assistant; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
|
||||
} // namespace voice_assistant
|
||||
|
||||
Reference in New Issue
Block a user