Validate devices
This commit is contained in:
@ -94,6 +94,21 @@ impl Handler<EnrollDevice> for EnergyActor {
|
||||
}
|
||||
}
|
||||
|
||||
/// Validate a device
|
||||
#[derive(Message)]
|
||||
#[rtype(result = "anyhow::Result<()>")]
|
||||
pub struct ValidateDevice(pub DeviceId);
|
||||
|
||||
impl Handler<ValidateDevice> for EnergyActor {
|
||||
type Result = anyhow::Result<()>;
|
||||
|
||||
fn handle(&mut self, msg: ValidateDevice, _ctx: &mut Context<Self>) -> Self::Result {
|
||||
log::info!("Requested to validate device {:?}...", &msg.0);
|
||||
self.devices.validate(&msg.0)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// Delete a device
|
||||
#[derive(Message)]
|
||||
#[rtype(result = "anyhow::Result<()>")]
|
||||
|
Reference in New Issue
Block a user