From cee51ecb2b38943ab03299b95f9e6a63d0768191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= <159137+therve@users.noreply.github.com> Date: Fri, 11 Jan 2019 02:45:50 +0100 Subject: [PATCH] Remove spurious libzwave error (#19928) If a network_key is not configuired, the following error is logged: TypeError: expected bytes, NoneType found Exception ignored in: 'libopenzwave.str_to_cppstr' TypeError: expected bytes, NoneType found We don't need to set the key if it's None, let's skip in that case. --- homeassistant/components/zwave/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/zwave/__init__.py b/homeassistant/components/zwave/__init__.py index 7860b545be2..093e6071bb4 100644 --- a/homeassistant/components/zwave/__init__.py +++ b/homeassistant/components/zwave/__init__.py @@ -284,7 +284,7 @@ async def async_setup_entry(hass, config_entry): options.set_console_output(use_debug) - if CONF_NETWORK_KEY in config_entry.data: + if config_entry.data.get(CONF_NETWORK_KEY): options.addOption("NetworkKey", config_entry.data[CONF_NETWORK_KEY]) await hass.async_add_executor_job(options.lock)