Skip to content

Commit

Permalink
type mapping for basic and unknown types
Browse files Browse the repository at this point in the history
  • Loading branch information
wuan committed Nov 28, 2024
1 parent 009e4fe commit ec04624
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mqtt-gateway"
version = "0.4.1"
version = "0.4.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
5 changes: 4 additions & 1 deletion src/data/openmqttgateway/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ impl OpenMqttGatewayParser {
}

if fields.contains_key("rssi") && fields.len() > 1 && tags.len() > base_tag_count {
data = Some(Data { fields, tags });
tags.insert(String::from("type"),String::from("NONE"));
} else if !tags.contains_key("type") {
tags.insert(String::from("type"),String::from("UNKN"));
}
data = Some(Data { fields, tags });
}
}
Ok(data)
Expand Down

0 comments on commit ec04624

Please sign in to comment.