mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Support num_repeats for roku remote (#34981)
This commit is contained in:
parent
1f66821256
commit
bb08959131
@ -7,7 +7,7 @@ from requests.exceptions import (
|
|||||||
)
|
)
|
||||||
from roku import RokuException
|
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.config_entries import ConfigEntry
|
||||||
from homeassistant.helpers.typing import HomeAssistantType
|
from homeassistant.helpers.typing import HomeAssistantType
|
||||||
|
|
||||||
@ -84,8 +84,11 @@ class RokuRemote(RemoteEntity):
|
|||||||
|
|
||||||
def send_command(self, command, **kwargs):
|
def send_command(self, command, **kwargs):
|
||||||
"""Send a command to one device."""
|
"""Send a command to one device."""
|
||||||
for single_command in command:
|
num_repeats = kwargs[ATTR_NUM_REPEATS]
|
||||||
if not hasattr(self.roku, single_command):
|
|
||||||
continue
|
|
||||||
|
|
||||||
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)()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user