Skip to content
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: 1 addition & 1 deletion homeassistant/components/xbox/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ async def async_send_command(self, command: Iterable[str], **kwargs: Any) -> Non
)
else:
await self.client.smartglass.insert_text(
self._console.id, single_command
self._console.id, single_command.removeprefix("text:")
)
Comment thread
tr4nt0r marked this conversation as resolved.
Comment thread
tr4nt0r marked this conversation as resolved.
await asyncio.sleep(delay)
7 changes: 5 additions & 2 deletions tests/components/xbox/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,13 @@ async def test_send_command(
call.assert_called_once_with("HIJKLMN")


@pytest.mark.parametrize(("text", "expected"), [("Hello", "Hello"), ("text:A", "A")])
async def test_send_text(
hass: HomeAssistant,
xbox_live_client: AsyncMock,
config_entry: MockConfigEntry,
text: str,
expected: str,
) -> None:
"""Test remote send text."""

Expand All @@ -160,12 +163,12 @@ async def test_send_text(
await hass.services.async_call(
REMOTE_DOMAIN,
SERVICE_SEND_COMMAND,
{ATTR_COMMAND: "Hello", ATTR_DELAY_SECS: 0},
{ATTR_COMMAND: text, ATTR_DELAY_SECS: 0},
target={ATTR_ENTITY_ID: "remote.xone"},
blocking=True,
)

xbox_live_client.smartglass.insert_text.assert_called_once_with("HIJKLMN", "Hello")
xbox_live_client.smartglass.insert_text.assert_called_once_with("HIJKLMN", expected)


async def test_turn_on(
Expand Down
Loading