From b8ea743843cb23c59f0cf0e34a072a279b877f1d Mon Sep 17 00:00:00 2001 From: Charles Spirakis Date: Wed, 30 Mar 2016 01:29:11 -0700 Subject: [PATCH] Enable zwave test_network command. Allows for testing the zwave network by sending a no-op command to all the nodes. In theory, this will also bring back nodes which have been put in the "presumed dead" state. --- homeassistant/components/zwave.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/homeassistant/components/zwave.py b/homeassistant/components/zwave.py index 213333ee877..31729c23f45 100644 --- a/homeassistant/components/zwave.py +++ b/homeassistant/components/zwave.py @@ -35,6 +35,7 @@ SERVICE_ADD_NODE = "add_node" SERVICE_REMOVE_NODE = "remove_node" SERVICE_HEAL_NETWORK = "heal_network" SERVICE_SOFT_RESET = "soft_reset" +SERVICE_TEST_NETWORK = "test_network" DISCOVER_SENSORS = "zwave.sensors" DISCOVER_SWITCHES = "zwave.switch" @@ -269,6 +270,10 @@ def setup(hass, config): """Soft reset the controller.""" NETWORK.controller.soft_reset() + def test_network(event): + """Test the network by sending commands to all the nodes.""" + NETWORK.test() + def stop_zwave(event): """Stop Z-Wave.""" NETWORK.stop() @@ -310,6 +315,7 @@ def setup(hass, config): hass.services.register(DOMAIN, SERVICE_REMOVE_NODE, remove_node) hass.services.register(DOMAIN, SERVICE_HEAL_NETWORK, heal_network) hass.services.register(DOMAIN, SERVICE_SOFT_RESET, soft_reset) + hass.services.register(DOMAIN, SERVICE_TEST_NETWORK, test_network) hass.bus.listen_once(EVENT_HOMEASSISTANT_START, start_zwave)