1 """Support for Keene Electronics IR-IP devices."""
3 from __future__
import annotations
5 from collections.abc
import Iterable
15 from .
import CONF_REMOTE, DOMAIN
17 _LOGGER = logging.getLogger(__name__)
23 add_entities: AddEntitiesCallback,
24 discovery_info: DiscoveryInfoType |
None =
None,
26 """Set up the Kira platform."""
28 name = discovery_info.get(CONF_NAME)
29 device = discovery_info.get(CONF_DEVICE)
31 kira = hass.data[DOMAIN][CONF_REMOTE][name]
36 """Remote representation used to send commands to a Kira device."""
39 """Initialize KiraRemote class."""
40 _LOGGER.debug(
"KiraRemote device init started for: %s", name)
44 def send_command(self, command: Iterable[str], **kwargs: Any) ->
None:
45 """Send a command to one device."""
46 for single_command
in command:
47 code_tuple = (single_command, kwargs.get(remote.ATTR_DEVICE))
48 _LOGGER.debug(
"Sending Command: %s to %s", *code_tuple)
49 self.
_kira_kira.sendCode(code_tuple)
def __init__(self, name, kira)
None send_command(self, Iterable[str] command, **Any kwargs)
None add_entities(AsusWrtRouter router, AddEntitiesCallback async_add_entities, set[str] tracked)
None setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback add_entities, DiscoveryInfoType|None discovery_info=None)