mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 05:05:09 +02:00
Support num_repeats for roku remote (#34981)
This commit is contained in:
@@ -7,7 +7,7 @@ from requests.exceptions import (
|
||||
)
|
||||
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
|
||||
|
||||
@@ -84,6 +84,9 @@ class RokuRemote(RemoteEntity):
|
||||
|
||||
def send_command(self, command, **kwargs):
|
||||
"""Send a command to one device."""
|
||||
num_repeats = kwargs[ATTR_NUM_REPEATS]
|
||||
|
||||
for _ in range(num_repeats):
|
||||
for single_command in command:
|
||||
if not hasattr(self.roku, single_command):
|
||||
continue
|
||||
|
Reference in New Issue
Block a user