From 43412166b0833d769892db2fc7b666a11d8bc16a Mon Sep 17 00:00:00 2001 From: ZoOL Date: Thu, 26 Sep 2024 18:44:40 +0800 Subject: [PATCH] release 0.4.2 --- CHANGELOG.md | 4 ++++ Cargo.toml | 2 +- examples/pub_and_sub.rs | 1 + src/lib.rs | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72f6fc8..7ffb409 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ 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). +## [0.4.2] - 2024-09-26 + +- MqttPublishPacket contains entity + ## [0.4.1] - 2024-09-26 - subscribe many topics same time diff --git a/Cargo.toml b/Cargo.toml index c34a4ff..406e83e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_mqtt" description = "A simple MQTT client for Bevy ECS" -version = "0.4.1" +version = "0.4.2" edition = "2021" readme = "README.md" repository = "https://github.com/foxzool/bevy_mqtt" diff --git a/examples/pub_and_sub.rs b/examples/pub_and_sub.rs index 29f5c52..b2a28e6 100644 --- a/examples/pub_and_sub.rs +++ b/examples/pub_and_sub.rs @@ -50,6 +50,7 @@ fn sub_topic( mut commands: Commands, ) { for (entity, client, setting) in mqtt_client.iter() { + // subscribe directly client .subscribe("hello".to_string(), QoS::AtMostOnce) .unwrap(); diff --git a/src/lib.rs b/src/lib.rs index 85ed27d..d6de663 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -106,6 +106,7 @@ pub struct MqttPublishOutgoing { #[derive(Debug, Event)] pub struct MqttPublishPacket { + pub entity: Entity, pub dup: bool, pub qos: QoS, pub retain: bool, @@ -140,6 +141,7 @@ fn handle_mqtt_events( } rumqttc::Event::Incoming(rumqttc::Incoming::Publish(publish)) => { publish_incoming.send(MqttPublishPacket { + entity, dup: publish.dup, qos: publish.qos, retain: publish.retain,