Use only node id to identify node in set_config_parameter (#3801)
parent
399a0b470a
commit
8f4608c654
|
@ -125,7 +125,7 @@ RENAME_NODE_SCHEMA = vol.Schema({
|
|||
vol.Required(const.ATTR_NAME): cv.string,
|
||||
})
|
||||
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_VALUE): 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):
|
||||
"""Set a config parameter to a node."""
|
||||
state = hass.states.get(service.data.get(ATTR_ENTITY_ID))
|
||||
node_id = state.attributes.get(const.ATTR_NODE_ID)
|
||||
node_id = service.data.get(const.ATTR_NODE_ID)
|
||||
node = NETWORK.nodes[node_id]
|
||||
param = service.data.get(const.ATTR_CONFIG_PARAMETER)
|
||||
value = service.data.get(const.ATTR_CONFIG_VALUE)
|
||||
|
|
|
@ -16,8 +16,8 @@ remove_node:
|
|||
set_config_parameter:
|
||||
description: Set a config parameter to a node on the Z-Wave network.
|
||||
fields:
|
||||
entity_id:
|
||||
description: Name of entity to set config parameter to.
|
||||
node_id:
|
||||
description: Node id of the device to set config parameter to (integer).
|
||||
parameter:
|
||||
description: Parameter number to set (integer).
|
||||
value:
|
||||
|
|
Loading…
Reference in New Issue