Skip to content
Merged
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
23 changes: 13 additions & 10 deletions homeassistant/components/directv/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from directv import DIRECTV, DIRECTVError

from homeassistant.components.remote import RemoteEntity
from homeassistant.components.remote import ATTR_NUM_REPEATS, RemoteEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType

Expand Down Expand Up @@ -95,12 +95,15 @@ async def async_send_command(self, command: Iterable[str], **kwargs: Any) -> Non
blue, chanup, chandown, prev, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9, dash, enter
"""
for single_command in command:
try:
await self.dtv.remote(single_command, self._address)
except DIRECTVError:
_LOGGER.exception(
"Sending command %s to device %s failed",
single_command,
self._device_id,
)
num_repeats = kwargs[ATTR_NUM_REPEATS]

for _ in range(num_repeats):
for single_command in command:
try:
await self.dtv.remote(single_command, self._address)
except DIRECTVError:
_LOGGER.exception(
"Sending command %s to device %s failed",
single_command,
self._device_id,
)