Display the list of pending devices in the UI
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
use crate::constants;
|
||||
use crate::devices::device::{DeviceId, DeviceInfo};
|
||||
use crate::devices::device::{Device, DeviceId, DeviceInfo};
|
||||
use crate::devices::devices_list::DevicesList;
|
||||
use crate::energy::consumption;
|
||||
use crate::energy::consumption::EnergyConsumption;
|
||||
@ -93,3 +93,16 @@ impl Handler<EnrollDevice> for EnergyActor {
|
||||
self.devices.enroll(&msg.0, &msg.1, &msg.2)
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the list of devices
|
||||
#[derive(Message)]
|
||||
#[rtype(result = "Vec<Device>")]
|
||||
pub struct GetDeviceLists;
|
||||
|
||||
impl Handler<GetDeviceLists> for EnergyActor {
|
||||
type Result = Vec<Device>;
|
||||
|
||||
fn handle(&mut self, _msg: GetDeviceLists, _ctx: &mut Context<Self>) -> Self::Result {
|
||||
self.devices.full_list()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user