Can get a single device enrollment status
This commit is contained in:
@ -137,3 +137,16 @@ impl Handler<GetDeviceLists> for EnergyActor {
|
||||
self.devices.full_list()
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the information about a single device
|
||||
#[derive(Message)]
|
||||
#[rtype(result = "Option<Device>")]
|
||||
pub struct GetSingleDevice(pub DeviceId);
|
||||
|
||||
impl Handler<GetSingleDevice> for EnergyActor {
|
||||
type Result = Option<Device>;
|
||||
|
||||
fn handle(&mut self, msg: GetSingleDevice, _ctx: &mut Context<Self>) -> Self::Result {
|
||||
self.devices.get_single(&msg.0)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user