Skip to content

Commit

Permalink
Merge pull request #997 from samson0v/master
Browse files Browse the repository at this point in the history
  • Loading branch information
imbeacon authored Nov 16, 2022
2 parents f8342c9 + 016163c commit c1b8354
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion thingsboard_gateway/connectors/mqtt/mqtt_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,13 @@ def _on_connect(self, client, userdata, flags, result_code, *extra_params):
continue

# Setup regexp topic acceptance list ---------------------------------------------------------------
regex_topic = TBUtility.topic_to_regex(mapping["topicFilter"])
# Check if topic is shared subscription type
# (an exception is aws topics that do not support shared subscription)
regex_topic = mapping["topicFilter"]
if not regex_topic.startswith('$aws') and regex_topic.startswith('$'):
regex_topic = '/'.join(regex_topic.split('/')[2:])
else:
regex_topic = TBUtility.topic_to_regex(regex_topic)

# There may be more than one converter per topic, so I'm using vectors
if not self.__mapping_sub_topics.get(regex_topic):
Expand Down

0 comments on commit c1b8354

Please sign in to comment.