smart-house-web: в работе
This commit is contained in:
12
smart-house-web/backend/src/server/debug.rs
Normal file
12
smart-house-web/backend/src/server/debug.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{Json, extract::State};
|
||||
|
||||
use crate::{Device, PowerSocket, Room, Thermometer};
|
||||
|
||||
pub async fn debug(State(_server_state): State<super::ServerState>) -> Json<Room> {
|
||||
let mut map = HashMap::<String, Device>::with_capacity(16);
|
||||
map.insert("therm_0".into(), Thermometer::new(22.5).into());
|
||||
map.insert("psock_0".into(), PowerSocket::new(12.1, false).into());
|
||||
Room::new(map).into()
|
||||
}
|
||||
Reference in New Issue
Block a user