From a18002dea0efb9c54819bb77f7b6fb6033b13983 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 9 Jun 2020 16:14:02 +0200 Subject: [PATCH] The command class of a Z-Wave value can also be null: prevent the plugin from breaking in such case --- platypush/plugins/zwave/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/plugins/zwave/__init__.py b/platypush/plugins/zwave/__init__.py index 2ff74f45..81485444 100644 --- a/platypush/plugins/zwave/__init__.py +++ b/platypush/plugins/zwave/__init__.py @@ -155,7 +155,7 @@ class ZwavePlugin(Plugin): return {} return { - 'command_class': value.node.get_command_class_as_string(value.command_class), + 'command_class': value.node.get_command_class_as_string(value.command_class) if value.command_class else None, 'data': value.data, 'data_as_string': value.data_as_string, 'data_items': list(value.data_items) if isinstance(value.data_items, set) else value.data_items, @@ -206,7 +206,7 @@ class ZwavePlugin(Plugin): 'node_id': node.node_id, 'home_id': node.home_id, 'capabilities': list(node.capabilities), - 'command_classes': [node.get_command_class_as_string(cc) for cc in node.command_classes] + 'command_classes': [node.get_command_class_as_string(cc) for cc in node.command_classes if cc] if hasattr(node, 'command_classes') else [], 'device_type': node.device_type if hasattr(node, 'device_type') else '', 'groups': {