diff --git a/homeassistant/components/switch/rpi_rf.py b/homeassistant/components/switch/rpi_rf.py index 2822f2fc9d4..361f4e0e934 100644 --- a/homeassistant/components/switch/rpi_rf.py +++ b/homeassistant/components/switch/rpi_rf.py @@ -21,13 +21,17 @@ CONF_CODE_ON = 'code_on' CONF_GPIO = 'gpio' CONF_PROTOCOL = 'protocol' CONF_PULSELENGTH = 'pulselength' +CONF_SIGNAL_REPETITIONS = 'signal_repetitions' DEFAULT_PROTOCOL = 1 +DEFAULT_SIGNAL_REPETITIONS = 10 SWITCH_SCHEMA = vol.Schema({ vol.Required(CONF_CODE_OFF): cv.positive_int, vol.Required(CONF_CODE_ON): cv.positive_int, vol.Optional(CONF_PULSELENGTH): cv.positive_int, + vol.Optional(CONF_SIGNAL_REPETITIONS, + default=DEFAULT_SIGNAL_REPETITIONS): cv.positive_int, vol.Optional(CONF_PROTOCOL, default=DEFAULT_PROTOCOL): cv.positive_int, }) @@ -55,6 +59,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): rfdevice, properties.get(CONF_PROTOCOL), properties.get(CONF_PULSELENGTH), + properties.get(CONF_SIGNAL_REPETITIONS), properties.get(CONF_CODE_ON), properties.get(CONF_CODE_OFF) ) @@ -69,7 +74,7 @@ class RPiRFSwitch(SwitchDevice): """Representation of a GPIO RF switch.""" def __init__(self, hass, name, rfdevice, protocol, pulselength, - code_on, code_off): + signal_repetitions, code_on, code_off): """Initialize the switch.""" self._hass = hass self._name = name @@ -79,6 +84,7 @@ class RPiRFSwitch(SwitchDevice): self._pulselength = pulselength self._code_on = code_on self._code_off = code_off + self._rfdevice.tx_repeat = signal_repetitions @property def should_poll(self):