Add parameter hold_secs for Harmony remote send command (#19650)

* Update requirements

Updated requirements

* Small bump for aioharmony

Small version bump increase for aioharmony

* Add attributes

Add firmware and config version attributes

* Add hold for button press on send_command

* Fix requirements file

For some reason aioharmony ended up in there as a duplicate. Fixed it.

* Revert rebase changes

Revert some changes that should have been reverted back as part of rebase.

* Updated based on review

Removed HOLD_SECS from platform schema (configuration)
Updated getting kwargs in async_send_command
Updated debug log to include delay_secs
This commit is contained in:
ehendrix23 authored and Anders Melchiorsen committed 2019-03-03 00:54:03 +01:00
1 parent b8eebda541
commit 833f17de04
3 files changed
+15 -5

No files matched your search

+8 -5
View File
@@ -7,9 +7,8 @@ import voluptuous as vol
from homeassistant.components import remote
from homeassistant.components.remote import (
ATTR_ACTIVITY, ATTR_DELAY_SECS, ATTR_DEVICE, ATTR_NUM_REPEATS,
DEFAULT_DELAY_SECS, DOMAIN, PLATFORM_SCHEMA
)
ATTR_ACTIVITY, ATTR_DELAY_SECS, ATTR_DEVICE, ATTR_HOLD_SECS,
ATTR_NUM_REPEATS, DEFAULT_DELAY_SECS, DOMAIN, PLATFORM_SCHEMA)
from homeassistant.const import (
ATTR_ENTITY_ID, CONF_HOST, CONF_NAME, CONF_PORT, EVENT_HOMEASSISTANT_STOP
)
@@ -340,8 +339,12 @@ class HarmonyRemote(remote.RemoteDevice):
_LOGGER.error("%s: Device %s is invalid", self.name, device)
return
num_repeats = kwargs.get(ATTR_NUM_REPEATS)
num_repeats = kwargs[ATTR_NUM_REPEATS]
delay_secs = kwargs.get(ATTR_DELAY_SECS, self._delay_secs)
hold_secs = kwargs[ATTR_HOLD_SECS]
_LOGGER.debug("Sending commands to device %s holding for %s seconds "
"with a delay of %s seconds",
device, hold_secs, delay_secs)
# Creating list of commands to send.
snd_cmnd_list = []
@@ -350,7 +353,7 @@ class HarmonyRemote(remote.RemoteDevice):
send_command = SendCommandDevice(
device=device_id,
command=single_command,
delay=0
delay=hold_secs
)
snd_cmnd_list.append(send_command)
if delay_secs > 0: