mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2025-02-22 02:42:19 +01:00
Adding announcement flag to media player command (#871)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
8e6717c197
commit
8778ad485c
@ -1175,6 +1175,9 @@ message MediaPlayerCommandRequest {
|
||||
|
||||
bool has_media_url = 6;
|
||||
string media_url = 7;
|
||||
|
||||
bool has_announcement = 8;
|
||||
bool announcement = 9;
|
||||
}
|
||||
|
||||
// ==================== BLUETOOTH ====================
|
||||
|
File diff suppressed because one or more lines are too long
@ -1192,6 +1192,7 @@ class APIClient:
|
||||
command: MediaPlayerCommand | None = None,
|
||||
volume: float | None = None,
|
||||
media_url: str | None = None,
|
||||
announcement: bool | None = None,
|
||||
) -> None:
|
||||
req = MediaPlayerCommandRequest(key=key)
|
||||
if command is not None:
|
||||
@ -1203,6 +1204,9 @@ class APIClient:
|
||||
if media_url is not None:
|
||||
req.media_url = media_url
|
||||
req.has_media_url = True
|
||||
if announcement is not None:
|
||||
req.announcement = announcement
|
||||
req.has_announcement = True
|
||||
self._get_connection().send_message(req)
|
||||
|
||||
def text_command(self, key: int, state: str) -> None:
|
||||
|
@ -794,6 +794,16 @@ async def test_select_command(
|
||||
dict(key=1, media_url="http://example.com"),
|
||||
dict(key=1, has_media_url=True, media_url="http://example.com"),
|
||||
),
|
||||
(
|
||||
dict(key=1, media_url="http://example.com", announcement=True),
|
||||
dict(
|
||||
key=1,
|
||||
has_media_url=True,
|
||||
media_url="http://example.com",
|
||||
has_announcement=True,
|
||||
announcement=True,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_media_player_command(
|
||||
|
Loading…
Reference in New Issue
Block a user