Skip to content

Commit

Permalink
fixup! feat: handle state change for device profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruadhri17 committed Aug 1, 2024
1 parent 717c94b commit 6ab2b7f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@ impl OperationContext {
match command.status() {
CommandStatus::Executing => Ok(OperationOutcome::Executing),
CommandStatus::Successful => {
let c8y_target_profile = MqttMessage::new(sm_topic, "121,true".to_string()); // Set the target profile as executed

let smartrest_set_operation =
smartrest::smartrest_serializer::succeed_operation_no_payload(
CumulocitySupportedOperations::C8yDeviceProfile,
);
let c8y_notification = MqttMessage::new(sm_topic, smartrest_set_operation);

Ok(OperationOutcome::Finished {
messages: vec![MqttMessage::new(sm_topic, smartrest_set_operation)],
messages: vec![c8y_target_profile, c8y_notification],
})
}
CommandStatus::Failed { reason } => Err(anyhow::anyhow!(reason).into()),
Expand Down

0 comments on commit 6ab2b7f

Please sign in to comment.