diff --git a/homeassistant/components/light/zwave.py b/homeassistant/components/light/zwave.py index 62c970badc1..10d8cdef4d9 100644 --- a/homeassistant/components/light/zwave.py +++ b/homeassistant/components/light/zwave.py @@ -19,7 +19,7 @@ from homeassistant.components.zwave import ( def setup_platform(hass, config, add_devices, discovery_info=None): """ Find and add Z-Wave lights. """ - if discovery_info is None: + if discovery_info is None or NETWORK is None: return node = NETWORK.nodes[discovery_info[ATTR_NODE_ID]] diff --git a/homeassistant/components/sensor/zwave.py b/homeassistant/components/sensor/zwave.py index fc3e27b212f..ddca961f3a5 100644 --- a/homeassistant/components/sensor/zwave.py +++ b/homeassistant/components/sensor/zwave.py @@ -52,7 +52,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): # platform: zwave # # `setup_platform` will be called without `discovery_info`. - if discovery_info is None: + if discovery_info is None or NETWORK is None: return node = NETWORK.nodes[discovery_info[ATTR_NODE_ID]] diff --git a/homeassistant/components/switch/zwave.py b/homeassistant/components/switch/zwave.py index 97254ed702f..150b8ba42be 100644 --- a/homeassistant/components/switch/zwave.py +++ b/homeassistant/components/switch/zwave.py @@ -15,7 +15,7 @@ from homeassistant.components.zwave import ( # pylint: disable=unused-argument def setup_platform(hass, config, add_devices, discovery_info=None): """ Find and return demo switches. """ - if discovery_info is None: + if discovery_info is None or NETWORK is None: return node = NETWORK.nodes[discovery_info[ATTR_NODE_ID]]