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
13 changes: 8 additions & 5 deletions homeassistant/components/roku/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
)
from roku import RokuException

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 @@ -84,8 +84,11 @@ def should_poll(self):

def send_command(self, command, **kwargs):
"""Send a command to one device."""
for single_command in command:
if not hasattr(self.roku, single_command):
continue
num_repeats = kwargs[ATTR_NUM_REPEATS]

getattr(self.roku, single_command)()
for _ in range(num_repeats):
for single_command in command:
if not hasattr(self.roku, single_command):
continue

getattr(self.roku, single_command)()