Skip to content

Commit

Permalink
Use MQTTv5 and shared subscriptions (#76)
Browse files Browse the repository at this point in the history
* Connect with MQTTv5

* Use shared subscription
  • Loading branch information
jschlyter authored Feb 12, 2025
1 parent 1ea1c25 commit b564644
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ The default configuration file is `evrec.toml`. Example configuration below:

[mqtt]
broker = "mqtt://localhost"
topic_read = "events/up/#"
topic_read = "$share/evrec/events/up/#"
topic_write = "verified"
reconnect_interval = 5
1 change: 1 addition & 0 deletions evrec/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ async def run(self):
port=self.settings.mqtt.broker.port,
username=self.settings.mqtt.broker.username,
password=self.settings.mqtt.broker.password,
protocol=aiomqtt.ProtocolVersion.V5,
) as client:
self.logger.info("MQTT connected to %s", self.settings.mqtt.broker)
await client.subscribe(self.settings.mqtt.topic_read)
Expand Down

0 comments on commit b564644

Please sign in to comment.