Can get the full list of relays through the API
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
use crate::app_config::AppConfig;
|
||||
use crate::crypto::pki;
|
||||
use crate::devices::device::{Device, DeviceGeneralInfo, DeviceId, DeviceInfo};
|
||||
use crate::devices::device::{Device, DeviceGeneralInfo, DeviceId, DeviceInfo, DeviceRelay};
|
||||
use crate::utils::time_utils::time_secs;
|
||||
use openssl::x509::{X509Req, X509};
|
||||
use std::collections::HashMap;
|
||||
@ -192,4 +192,12 @@ impl DevicesList {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Get the full list of relays
|
||||
pub fn relays_list(&mut self) -> Vec<DeviceRelay> {
|
||||
self.0
|
||||
.iter()
|
||||
.flat_map(|(_id, d)| d.relays.clone())
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user