Skip to content

Commit 3a4b862

Browse files
ctalkingtonballoob
authored andcommitted
Support num_repeats for roku remote (#34981)
1 parent 42dd3ba commit 3a4b862

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

homeassistant/components/roku/remote.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
)
88
from roku import RokuException
99

10-
from homeassistant.components.remote import RemoteDevice
10+
from homeassistant.components.remote import ATTR_NUM_REPEATS, RemoteDevice
1111
from homeassistant.config_entries import ConfigEntry
1212
from homeassistant.helpers.typing import HomeAssistantType
1313

@@ -84,8 +84,11 @@ def should_poll(self):
8484

8585
def send_command(self, command, **kwargs):
8686
"""Send a command to one device."""
87-
for single_command in command:
88-
if not hasattr(self.roku, single_command):
89-
continue
87+
num_repeats = kwargs[ATTR_NUM_REPEATS]
9088

91-
getattr(self.roku, single_command)()
89+
for _ in range(num_repeats):
90+
for single_command in command:
91+
if not hasattr(self.roku, single_command):
92+
continue
93+
94+
getattr(self.roku, single_command)()

0 commit comments

Comments
 (0)