Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handing share topics #5

Merged
merged 4 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## Unreleased

### Fixed:

- Fix handing share topics, [PR-5](https://github.com/panda-official/DriftMqtt/pull/5)

## 0.2.0 - 2023-04-28

- Support for MQTTv5, [PR-4](https://github.com/panda-official/DriftMqtt/pull/4)
### Added:

- Support for MQTTv5, [PR-4](https://github.com/panda-official/DriftMqtt/pull/4)
- DRIFT-534: Dependencies compatibility table, [PR-3](https://github.com/panda-official/DriftMqtt/pull/3)

## 0.1.1 - 2022-09-27

### Fixed

- Subscribing topics with wildcards, [PR-1](https://github.com/panda-official/DriftMqtt/pull/1)
- Add installation instructions to README, [PR-2](https://github.com/panda-official/DriftMqtt/pull/2)
- Add installation instructions to README, [PR-2](https://github.com/panda-official/DriftMqtt/pull/2)

## 0.1.0 - 2022-09-23

Expand Down
6 changes: 6 additions & 0 deletions pkg/drift_mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ def on_message(self, _client, _userdata, message: MQTTMessage):
try:
if re.match(sub.topic.replace("#", "(.*)"), message.topic):
sub.handler(message)
elif (
re.search(r"\$share\/([a-zA-Z-_]*)\/(.*)", sub.topic).group(2)
== message.topic
):
sub.handler(message)

except Exception as err: # pylint: disable=broad-except
logger.exception("Error in a message handler: %s", err)

Expand Down