mirror of
https://github.com/esphome/esphome.git
synced 2025-03-14 06:38:17 +00:00
[api] add voice assistant announce to the api (#8395)
This commit is contained in:
parent
bd853e6883
commit
00000e0ea8
@ -1567,6 +1567,8 @@ message VoiceAssistantAnnounceRequest {
|
||||
|
||||
string media_id = 1;
|
||||
string text = 2;
|
||||
string preannounce_media_id = 3;
|
||||
bool start_conversation = 4;
|
||||
}
|
||||
|
||||
message VoiceAssistantAnnounceFinished {
|
||||
|
@ -7094,6 +7094,16 @@ void VoiceAssistantTimerEventResponse::dump_to(std::string &out) const {
|
||||
out.append("}");
|
||||
}
|
||||
#endif
|
||||
bool VoiceAssistantAnnounceRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
||||
switch (field_id) {
|
||||
case 4: {
|
||||
this->start_conversation = value.as_bool();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool VoiceAssistantAnnounceRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
|
||||
switch (field_id) {
|
||||
case 1: {
|
||||
@ -7104,6 +7114,10 @@ bool VoiceAssistantAnnounceRequest::decode_length(uint32_t field_id, ProtoLength
|
||||
this->text = value.as_string();
|
||||
return true;
|
||||
}
|
||||
case 3: {
|
||||
this->preannounce_media_id = value.as_string();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -7111,6 +7125,8 @@ bool VoiceAssistantAnnounceRequest::decode_length(uint32_t field_id, ProtoLength
|
||||
void VoiceAssistantAnnounceRequest::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_string(1, this->media_id);
|
||||
buffer.encode_string(2, this->text);
|
||||
buffer.encode_string(3, this->preannounce_media_id);
|
||||
buffer.encode_bool(4, this->start_conversation);
|
||||
}
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void VoiceAssistantAnnounceRequest::dump_to(std::string &out) const {
|
||||
@ -7123,6 +7139,14 @@ void VoiceAssistantAnnounceRequest::dump_to(std::string &out) const {
|
||||
out.append(" text: ");
|
||||
out.append("'").append(this->text).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" preannounce_media_id: ");
|
||||
out.append("'").append(this->preannounce_media_id).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" start_conversation: ");
|
||||
out.append(YESNO(this->start_conversation));
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
#endif
|
||||
|
@ -1832,6 +1832,8 @@ class VoiceAssistantAnnounceRequest : public ProtoMessage {
|
||||
public:
|
||||
std::string media_id{};
|
||||
std::string text{};
|
||||
std::string preannounce_media_id{};
|
||||
bool start_conversation{false};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
#ifdef HAS_PROTO_MESSAGE_DUMP
|
||||
void dump_to(std::string &out) const override;
|
||||
@ -1839,6 +1841,7 @@ class VoiceAssistantAnnounceRequest : public ProtoMessage {
|
||||
|
||||
protected:
|
||||
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
|
||||
bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
|
||||
};
|
||||
class VoiceAssistantAnnounceFinished : public ProtoMessage {
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user