Use only node id to identify node in set_config_parameter (#3801)

This commit is contained in:
John Arild Berentsen 2016-10-14 08:45:00 +02:00 committed by Paulus Schoutsen
parent 399a0b470a
commit 8f4608c654
2 changed files with 4 additions and 5 deletions

View file

@ -125,7 +125,7 @@ RENAME_NODE_SCHEMA = vol.Schema({
vol.Required(const.ATTR_NAME): cv.string, vol.Required(const.ATTR_NAME): cv.string,
}) })
SET_CONFIG_PARAMETER_SCHEMA = vol.Schema({ SET_CONFIG_PARAMETER_SCHEMA = vol.Schema({
vol.Required(ATTR_ENTITY_ID): cv.entity_id, vol.Required(const.ATTR_NODE_ID): vol.Coerce(int),
vol.Required(const.ATTR_CONFIG_PARAMETER): vol.Coerce(int), vol.Required(const.ATTR_CONFIG_PARAMETER): vol.Coerce(int),
vol.Required(const.ATTR_CONFIG_VALUE): vol.Coerce(int), vol.Required(const.ATTR_CONFIG_VALUE): vol.Coerce(int),
vol.Optional(const.ATTR_CONFIG_SIZE): vol.Coerce(int) vol.Optional(const.ATTR_CONFIG_SIZE): vol.Coerce(int)
@ -428,8 +428,7 @@ def setup(hass, config):
def set_config_parameter(service): def set_config_parameter(service):
"""Set a config parameter to a node.""" """Set a config parameter to a node."""
state = hass.states.get(service.data.get(ATTR_ENTITY_ID)) node_id = service.data.get(const.ATTR_NODE_ID)
node_id = state.attributes.get(const.ATTR_NODE_ID)
node = NETWORK.nodes[node_id] node = NETWORK.nodes[node_id]
param = service.data.get(const.ATTR_CONFIG_PARAMETER) param = service.data.get(const.ATTR_CONFIG_PARAMETER)
value = service.data.get(const.ATTR_CONFIG_VALUE) value = service.data.get(const.ATTR_CONFIG_VALUE)

View file

@ -16,8 +16,8 @@ remove_node:
set_config_parameter: set_config_parameter:
description: Set a config parameter to a node on the Z-Wave network. description: Set a config parameter to a node on the Z-Wave network.
fields: fields:
entity_id: node_id:
description: Name of entity to set config parameter to. description: Node id of the device to set config parameter to (integer).
parameter: parameter:
description: Parameter number to set (integer). description: Parameter number to set (integer).
value: value: