Support learning different command types with remote (#39670)

This commit is contained in:
Felipe Martins Diel authored and GitHub committed 2020-09-22 22:09:19 -05:00
1 parent 5ebce075a1
commit c6a48d3b61
4 files changed
+11

No files matched your search

+5
View File
@@ -7,6 +7,7 @@ from homeassistant.components.remote import (
ATTR_ACTIVITY,
ATTR_ALTERNATIVE,
ATTR_COMMAND,
ATTR_COMMAND_TYPE,
ATTR_DELAY_SECS,
ATTR_DEVICE,
ATTR_NUM_REPEATS,
@@ -81,6 +82,7 @@ def learn_command(
device=None,
command=None,
alternative=None,
command_type=None,
timeout=None,
):
"""Learn a command from a device."""
@@ -94,6 +96,9 @@ def learn_command(
if command:
data[ATTR_COMMAND] = command
if command_type:
data[ATTR_COMMAND_TYPE] = command_type
if alternative:
data[ATTR_ALTERNATIVE] = alternative