Support num_repeats for directv remote (#34982)
parent
7b90cbd2b2
commit
1f66821256
|
@ -5,7 +5,7 @@ from typing import Any, Callable, Iterable, List
|
||||||
|
|
||||||
from directv import DIRECTV, DIRECTVError
|
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.config_entries import ConfigEntry
|
||||||
from homeassistant.helpers.typing import HomeAssistantType
|
from homeassistant.helpers.typing import HomeAssistantType
|
||||||
|
|
||||||
|
@ -95,12 +95,15 @@ class DIRECTVRemote(DIRECTVEntity, RemoteEntity):
|
||||||
blue, chanup, chandown, prev, 0, 1, 2, 3, 4, 5,
|
blue, chanup, chandown, prev, 0, 1, 2, 3, 4, 5,
|
||||||
6, 7, 8, 9, dash, enter
|
6, 7, 8, 9, dash, enter
|
||||||
"""
|
"""
|
||||||
for single_command in command:
|
num_repeats = kwargs[ATTR_NUM_REPEATS]
|
||||||
try:
|
|
||||||
await self.dtv.remote(single_command, self._address)
|
for _ in range(num_repeats):
|
||||||
except DIRECTVError:
|
for single_command in command:
|
||||||
_LOGGER.exception(
|
try:
|
||||||
"Sending command %s to device %s failed",
|
await self.dtv.remote(single_command, self._address)
|
||||||
single_command,
|
except DIRECTVError:
|
||||||
self._device_id,
|
_LOGGER.exception(
|
||||||
)
|
"Sending command %s to device %s failed",
|
||||||
|
single_command,
|
||||||
|
self._device_id,
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in New Issue