mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Zwave: Add remove/replace failed node services. (#6248)
* Zwave: Add remove/replace failed node services. * Fix text
This commit is contained in:
parent
50887e7e2c
commit
597ae2e716
@ -156,7 +156,7 @@ PRINT_CONFIG_PARAMETER_SCHEMA = vol.Schema({
|
|||||||
vol.Required(const.ATTR_CONFIG_PARAMETER): vol.Coerce(int),
|
vol.Required(const.ATTR_CONFIG_PARAMETER): vol.Coerce(int),
|
||||||
})
|
})
|
||||||
|
|
||||||
PRINT_NODE_SCHEMA = vol.Schema({
|
NODE_SERVICE_SCHEMA = vol.Schema({
|
||||||
vol.Required(const.ATTR_NODE_ID): vol.Coerce(int),
|
vol.Required(const.ATTR_NODE_ID): vol.Coerce(int),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -525,6 +525,18 @@ def setup(hass, config):
|
|||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
"Renamed ZWave node %d to %s", node_id, name)
|
"Renamed ZWave node %d to %s", node_id, name)
|
||||||
|
|
||||||
|
def remove_failed_node(service):
|
||||||
|
"""Remove failed node."""
|
||||||
|
node_id = service.data.get(const.ATTR_NODE_ID)
|
||||||
|
_LOGGER.info('Trying to remove zwave node %d', node_id)
|
||||||
|
NETWORK.controller.remove_failed_node(node_id)
|
||||||
|
|
||||||
|
def replace_failed_node(service):
|
||||||
|
"""Replace failed node."""
|
||||||
|
node_id = service.data.get(const.ATTR_NODE_ID)
|
||||||
|
_LOGGER.info('Trying to replace zwave node %d', node_id)
|
||||||
|
NETWORK.controller.replace_failed_node(node_id)
|
||||||
|
|
||||||
def set_config_parameter(service):
|
def set_config_parameter(service):
|
||||||
"""Set a config parameter to a node."""
|
"""Set a config parameter to a node."""
|
||||||
node_id = service.data.get(const.ATTR_NODE_ID)
|
node_id = service.data.get(const.ATTR_NODE_ID)
|
||||||
@ -671,6 +683,15 @@ def setup(hass, config):
|
|||||||
descriptions[
|
descriptions[
|
||||||
const.SERVICE_PRINT_CONFIG_PARAMETER],
|
const.SERVICE_PRINT_CONFIG_PARAMETER],
|
||||||
schema=PRINT_CONFIG_PARAMETER_SCHEMA)
|
schema=PRINT_CONFIG_PARAMETER_SCHEMA)
|
||||||
|
hass.services.register(DOMAIN, const.SERVICE_REMOVE_FAILED_NODE,
|
||||||
|
remove_failed_node,
|
||||||
|
descriptions[const.SERVICE_REMOVE_FAILED_NODE],
|
||||||
|
schema=NODE_SERVICE_SCHEMA)
|
||||||
|
hass.services.register(DOMAIN, const.SERVICE_REPLACE_FAILED_NODE,
|
||||||
|
replace_failed_node,
|
||||||
|
descriptions[const.SERVICE_REPLACE_FAILED_NODE],
|
||||||
|
schema=NODE_SERVICE_SCHEMA)
|
||||||
|
|
||||||
hass.services.register(DOMAIN, const.SERVICE_CHANGE_ASSOCIATION,
|
hass.services.register(DOMAIN, const.SERVICE_CHANGE_ASSOCIATION,
|
||||||
change_association,
|
change_association,
|
||||||
descriptions[
|
descriptions[
|
||||||
@ -685,7 +706,7 @@ def setup(hass, config):
|
|||||||
print_node,
|
print_node,
|
||||||
descriptions[
|
descriptions[
|
||||||
const.SERVICE_PRINT_NODE],
|
const.SERVICE_PRINT_NODE],
|
||||||
schema=PRINT_NODE_SCHEMA)
|
schema=NODE_SERVICE_SCHEMA)
|
||||||
|
|
||||||
# Setup autoheal
|
# Setup autoheal
|
||||||
if autoheal:
|
if autoheal:
|
||||||
|
@ -28,6 +28,8 @@ SERVICE_TEST_NETWORK = "test_network"
|
|||||||
SERVICE_SET_CONFIG_PARAMETER = "set_config_parameter"
|
SERVICE_SET_CONFIG_PARAMETER = "set_config_parameter"
|
||||||
SERVICE_PRINT_CONFIG_PARAMETER = "print_config_parameter"
|
SERVICE_PRINT_CONFIG_PARAMETER = "print_config_parameter"
|
||||||
SERVICE_PRINT_NODE = "print_node"
|
SERVICE_PRINT_NODE = "print_node"
|
||||||
|
SERVICE_REMOVE_FAILED_NODE = "remove_failed_node"
|
||||||
|
SERVICE_REPLACE_FAILED_NODE = "replace_failed_node"
|
||||||
SERVICE_SET_WAKEUP = "set_wakeup"
|
SERVICE_SET_WAKEUP = "set_wakeup"
|
||||||
SERVICE_STOP_NETWORK = "stop_network"
|
SERVICE_STOP_NETWORK = "stop_network"
|
||||||
SERVICE_START_NETWORK = "start_network"
|
SERVICE_START_NETWORK = "start_network"
|
||||||
|
@ -27,6 +27,18 @@ heal_network:
|
|||||||
remove_node:
|
remove_node:
|
||||||
description: Remove a node from the Z-Wave network. Refer to OZW.log for details.
|
description: Remove a node from the Z-Wave network. Refer to OZW.log for details.
|
||||||
|
|
||||||
|
remove_failed_node:
|
||||||
|
descsription: This command will remove a failed node from the network. The node should be on the controllers failed nodes list, otherwise this command will fail. Refer to OZW.log for details.
|
||||||
|
fields:
|
||||||
|
node_id:
|
||||||
|
description: Node id of the device to remove (integer).
|
||||||
|
|
||||||
|
replace_failed_node:
|
||||||
|
descsription: Replace a failed node with another. If the node is not in the controller's failed nodes list, or the node responds, this command will fail. Refer to OZW.log for details.
|
||||||
|
fields:
|
||||||
|
node_id:
|
||||||
|
description: Node id of the device to replace (integer).
|
||||||
|
|
||||||
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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user