Store last ping of devices
This commit is contained in:
@ -28,6 +28,13 @@ pub async fn list_validated(actor: WebEnergyActor) -> HttpResult {
|
||||
Ok(HttpResponse::Ok().json(list))
|
||||
}
|
||||
|
||||
/// Get the state of devices
|
||||
pub async fn devices_state(actor: WebEnergyActor) -> HttpResult {
|
||||
let states = actor.send(energy_actor::GetDevicesState).await?;
|
||||
|
||||
Ok(HttpResponse::Ok().json(states))
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct DeviceInPath {
|
||||
id: DeviceId,
|
||||
|
Reference in New Issue
Block a user