Can get a single device enrollment status

This commit is contained in:
2024-07-03 22:05:19 +02:00
parent e97ef6fe45
commit 8674d25512
7 changed files with 91 additions and 8 deletions

View File

@ -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)
}
}