Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preannounce media url and start conversation to voice assistant announce message #1099

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions aioesphomeapi/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1583,6 +1583,8 @@ message VoiceAssistantAnnounceRequest {

string media_id = 1;
string text = 2;
string preannounce_media_id = 3;
bool start_conversation = 4;
}

message VoiceAssistantAnnounceFinished {
Expand Down
242 changes: 121 additions & 121 deletions aioesphomeapi/api_pb2.py

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion aioesphomeapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,9 +1484,16 @@ async def send_voice_assistant_announcement_await_response(
media_id: str,
timeout: float,
text: str = "",
preannounce_media_id: str = "",
start_conversation: bool = False,
) -> VoiceAssistantAnnounceFinishedModel:
resp = await self._get_connection().send_message_await_response(
VoiceAssistantAnnounceRequest(media_id=media_id, text=text),
VoiceAssistantAnnounceRequest(
media_id=media_id,
text=text,
preannounce_media_id=preannounce_media_id,
start_conversation=start_conversation,
),
VoiceAssistantAnnounceFinished,
timeout,
)
Expand Down
1 change: 1 addition & 0 deletions aioesphomeapi/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class VoiceAssistantFeature(enum.IntFlag):
API_AUDIO = 1 << 2
TIMERS = 1 << 3
ANNOUNCE = 1 << 4
START_CONVERSATION = 1 << 5


class VoiceAssistantSubscriptionFlag(enum.IntFlag):
Expand Down