Can get the full list of relays through the API

This commit is contained in:
2024-07-24 23:35:58 +02:00
parent 4d5ba939d1
commit 73163e6e69
5 changed files with 43 additions and 2 deletions

View File

@ -0,0 +1,10 @@
use crate::energy::energy_actor;
use crate::server::custom_error::HttpResult;
use crate::server::WebEnergyActor;
use actix_web::HttpResponse;
/// Get the full list of relays
pub async fn get_list(actor: WebEnergyActor) -> HttpResult {
let list = actor.send(energy_actor::GetRelaysList).await?;
Ok(HttpResponse::Ok().json(list))
}