mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 13:34:54 +01:00
commit
f56e89597f
4 changed files with 10 additions and 5 deletions
|
@ -428,10 +428,12 @@ void APIServer::on_shutdown() {
|
|||
}
|
||||
|
||||
#ifdef USE_VOICE_ASSISTANT
|
||||
void APIServer::start_voice_assistant() {
|
||||
bool APIServer::start_voice_assistant() {
|
||||
bool result = false;
|
||||
for (auto &c : this->clients_) {
|
||||
c->request_voice_assistant(true);
|
||||
result |= c->request_voice_assistant(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
void APIServer::stop_voice_assistant() {
|
||||
for (auto &c : this->clients_) {
|
||||
|
|
|
@ -96,7 +96,7 @@ class APIServer : public Component, public Controller {
|
|||
#endif
|
||||
|
||||
#ifdef USE_VOICE_ASSISTANT
|
||||
void start_voice_assistant();
|
||||
bool start_voice_assistant();
|
||||
void stop_voice_assistant();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -63,7 +63,10 @@ void VoiceAssistant::start(struct sockaddr_storage *addr, uint16_t port) {
|
|||
|
||||
void VoiceAssistant::request_start() {
|
||||
ESP_LOGD(TAG, "Requesting start...");
|
||||
api::global_api_server->start_voice_assistant();
|
||||
if (!api::global_api_server->start_voice_assistant()) {
|
||||
ESP_LOGW(TAG, "Could not request start.");
|
||||
this->error_trigger_->trigger("not-connected", "Could not request start.");
|
||||
}
|
||||
}
|
||||
|
||||
void VoiceAssistant::signal_stop() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"""Constants used by esphome."""
|
||||
|
||||
__version__ = "2023.4.0b2"
|
||||
__version__ = "2023.4.0b3"
|
||||
|
||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
|
||||
|
|
Loading…
Reference in a new issue