From 7f06214dafc1dda440cc49e55b1240002ca35933 Mon Sep 17 00:00:00 2001 From: Karel Blavka Date: Tue, 7 Aug 2018 11:59:00 +0200 Subject: [PATCH] Remove "kit-" from firmware name --- bcg/gateway.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bcg/gateway.py b/bcg/gateway.py index f9cbf8e..3ed8a38 100755 --- a/bcg/gateway.py +++ b/bcg/gateway.py @@ -36,7 +36,7 @@ }, 'base_topic_prefix': '', # ie. 'bigclown-' 'name': None, - 'automatic_rename_kit_nodes': True, + 'automatic_remove_kit_from_names': True, 'automatic_rename_generic_nodes': True, 'automatic_rename_nodes': True, 'rename': {} @@ -352,8 +352,9 @@ def node_message(self, subtopic, payload): name_base = 'generic-node' elif self._config['automatic_rename_nodes']: name_base = payload['firmware'] - elif self._config['automatic_rename_kit_nodes'] and payload['firmware'].startswith("kit-"): - name_base = payload['firmware'] + + if self._config['automatic_remove_kit_from_names'] and name_base.startswith("kit-"): + name_base = name_base[4:] if name_base: for i in range(0, 32):