Skip to content

Commit

Permalink
feat: handle state change for device profile
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Piotrowski <[email protected]>
  • Loading branch information
Ruadhri17 committed Aug 6, 2024
1 parent 14eddc8 commit 9651797
Show file tree
Hide file tree
Showing 3 changed files with 510 additions and 1 deletion.
7 changes: 7 additions & 0 deletions crates/core/c8y_api/src/smartrest/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ impl From<C8ySmartRestSetInterval117> for MqttMessage {
}
}

/// Create a SmartREST payload for setting/updating the current state of the target profile
/// in its own managed object. When all individual operations are finished (i.e. firmware update, software update
/// and configuration update), the `profile_executed` field should be set to `true`, otherwise it should be `false`.
pub fn set_c8y_profile_target_payload(profile_executed: bool) -> String {
fields_to_csv_string(&["121", &profile_executed.to_string()])
}

#[derive(thiserror::Error, Debug)]
#[error("Field `{field_name}` contains invalid value: {value:?}")]
pub struct InvalidValueError {
Expand Down
Loading

0 comments on commit 9651797

Please sign in to comment.