mirror of
https://github.com/esphome/esphome.git
synced 2025-08-05 09:57:47 +00:00
preen
This commit is contained in:
parent
98d091fbc3
commit
80c66b0742
@ -1218,7 +1218,7 @@ void APIConnection::bluetooth_scanner_set_mode(const BluetoothScannerSetModeRequ
|
||||
#endif
|
||||
|
||||
#ifdef USE_VOICE_ASSISTANT
|
||||
bool APIConnection::check_voice_assistant_api_connection() const {
|
||||
bool APIConnection::check_voice_assistant_api_connection_() const {
|
||||
return voice_assistant::global_voice_assistant != nullptr &&
|
||||
voice_assistant::global_voice_assistant->get_api_connection() == this;
|
||||
}
|
||||
@ -1229,7 +1229,7 @@ void APIConnection::subscribe_voice_assistant(const SubscribeVoiceAssistantReque
|
||||
}
|
||||
}
|
||||
void APIConnection::on_voice_assistant_response(const VoiceAssistantResponse &msg) {
|
||||
if (!this->check_voice_assistant_api_connection()) {
|
||||
if (!this->check_voice_assistant_api_connection_()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1248,23 +1248,23 @@ void APIConnection::on_voice_assistant_response(const VoiceAssistantResponse &ms
|
||||
}
|
||||
};
|
||||
void APIConnection::on_voice_assistant_event_response(const VoiceAssistantEventResponse &msg) {
|
||||
if (this->check_voice_assistant_api_connection()) {
|
||||
if (this->check_voice_assistant_api_connection_()) {
|
||||
voice_assistant::global_voice_assistant->on_event(msg);
|
||||
}
|
||||
}
|
||||
void APIConnection::on_voice_assistant_audio(const VoiceAssistantAudio &msg) {
|
||||
if (this->check_voice_assistant_api_connection()) {
|
||||
if (this->check_voice_assistant_api_connection_()) {
|
||||
voice_assistant::global_voice_assistant->on_audio(msg);
|
||||
}
|
||||
};
|
||||
void APIConnection::on_voice_assistant_timer_event_response(const VoiceAssistantTimerEventResponse &msg) {
|
||||
if (this->check_voice_assistant_api_connection()) {
|
||||
if (this->check_voice_assistant_api_connection_()) {
|
||||
voice_assistant::global_voice_assistant->on_timer_event(msg);
|
||||
}
|
||||
};
|
||||
|
||||
void APIConnection::on_voice_assistant_announce_request(const VoiceAssistantAnnounceRequest &msg) {
|
||||
if (this->check_voice_assistant_api_connection()) {
|
||||
if (this->check_voice_assistant_api_connection_()) {
|
||||
voice_assistant::global_voice_assistant->on_announce(msg);
|
||||
}
|
||||
}
|
||||
@ -1272,7 +1272,7 @@ void APIConnection::on_voice_assistant_announce_request(const VoiceAssistantAnno
|
||||
VoiceAssistantConfigurationResponse APIConnection::voice_assistant_get_configuration(
|
||||
const VoiceAssistantConfigurationRequest &msg) {
|
||||
VoiceAssistantConfigurationResponse resp;
|
||||
if (!this->check_voice_assistant_api_connection()) {
|
||||
if (!this->check_voice_assistant_api_connection_()) {
|
||||
return resp;
|
||||
}
|
||||
|
||||
@ -1294,7 +1294,7 @@ VoiceAssistantConfigurationResponse APIConnection::voice_assistant_get_configura
|
||||
}
|
||||
|
||||
void APIConnection::voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &msg) {
|
||||
if (this->check_voice_assistant_api_connection()) {
|
||||
if (this->check_voice_assistant_api_connection_()) {
|
||||
voice_assistant::global_voice_assistant->on_set_configuration(msg.active_wake_words);
|
||||
}
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ class APIConnection : public APIServerConnection {
|
||||
|
||||
#ifdef USE_VOICE_ASSISTANT
|
||||
// Helper to check voice assistant validity and connection ownership
|
||||
bool check_voice_assistant_api_connection() const;
|
||||
bool check_voice_assistant_api_connection_() const;
|
||||
#endif
|
||||
|
||||
// Helper method to process multiple entities from an iterator in a batch
|
||||
|
Loading…
x
Reference in New Issue
Block a user