13 lines
434 B
Rust
13 lines
434 B
Rust
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()
|
|
}
|