Skip to content
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
47 changes: 43 additions & 4 deletions Cargo.lock

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

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ astarte-message-hub-proto = { workspace = true, optional = true }
base64 = { workspace = true }
bson = { workspace = true, features = ["chrono-0_4"] }
bytes = { workspace = true }
cfg-if = { workspace = true }
chrono = { workspace = true, features = ["serde"] }
flate2 = { workspace = true }
flume = { workspace = true, features = ["async"] }
Expand Down Expand Up @@ -98,6 +99,8 @@ reqwest = { workspace = true, features = ["macos-system-configuration"] }

[dev-dependencies]
astarte-device-sdk-derive = { workspace = true }
astarte-message-hub-proto = { workspace = true }
astarte-message-hub-proto-mock = { workspace = true }
async-trait = { workspace = true }
color-eyre = { workspace = true }
env_logger = { workspace = true }
Expand Down Expand Up @@ -131,11 +134,13 @@ rustc-args = ["--cfg=docsrs"]
[workspace.dependencies]
astarte-device-sdk = { path = "./", version = "=0.9.6" }
astarte-device-sdk-derive = { version = "=0.9.6", path = "./astarte-device-sdk-derive" }
astarte-message-hub-proto = { git = "https://github.com/astarte-platform/astarte-message-hub-proto", rev = "27f386114528ceeeb81440879f259146fbed6052" }
astarte-message-hub-proto = { git = "https://github.com/astarte-platform/astarte-message-hub-proto", rev = "20ba40215172613bfab149676adf0dbd9f3ccc92" }
astarte-message-hub-proto-mock = { git = "https://github.com/astarte-platform/astarte-message-hub-proto", rev = "20ba40215172613bfab149676adf0dbd9f3ccc92" }
async-trait = "0.1.67"
base64 = "0.22.0"
bson = "2.7.0"
bytes = "1.5.0"
cfg-if = "1.0.0"
chrono = "0.4.20"
color-eyre = "0.6.3"
env_logger = "0.11.0"
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ mod test {
pub(crate) const E2E_DEVICE_DATASTREAM: &str = include_str!(
"../e2e-test/interfaces/org.astarte-platform.rust.e2etest.DeviceDatastream.json"
);
pub(crate) const E2E_SERVER_DATASTREAM: &str = include_str!(
"../e2e-test/interfaces/org.astarte-platform.rust.e2etest.ServerAggregate.json"
);
pub(crate) const E2E_DEVICE_AGGREGATE: &str = include_str!(
"../e2e-test/interfaces/org.astarte-platform.rust.e2etest.DeviceAggregate.json"
);
Expand Down
13 changes: 13 additions & 0 deletions src/transport/grpc/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ impl From<DeviceEvent> for astarte_message_hub_proto::AstarteMessage {
}
}

// TODO this is incomplete, no way of creating a PropertyIndividual with a set value
// refactor value to include a property type or find a way of stashing that information
// somewhere
impl From<Value> for ProtoPayload {
fn from(value: Value) -> Self {
match value {
Expand Down Expand Up @@ -463,6 +466,16 @@ pub(crate) mod test {
}
}

pub(crate) fn new_property(
path: String,
data: Option<AstarteType>,
) -> astarte_message_hub_proto::Property {
astarte_message_hub_proto::Property {
path,
data: data.map(|s| s.into()),
}
}

#[test]
fn proto_astarte_double_into_astarte_device_sdk_type_success() {
let value = 15.5;
Expand Down
Loading
Loading