Store devices wrapped in Arc RwLock

This commit is contained in:
2023-08-11 02:24:58 +02:00
parent 7733e8cc8f
commit 330523166f
13 changed files with 538 additions and 457 deletions

View File

@@ -1,5 +1,4 @@
use std::{
collections::HashMap,
fs,
net::{Ipv4Addr, SocketAddr},
time::Duration,
@@ -32,8 +31,8 @@ pub struct Config {
pub light_sensor: LightSensorConfig,
pub hue_bridge: Option<HueBridgeConfig>,
pub debug_bridge: Option<DebugBridgeConfig>,
#[serde(default)]
pub devices: HashMap<String, DeviceConfig>,
#[serde(default, with = "tuple_vec_map")]
pub devices: Vec<(String, DeviceConfig)>,
}
#[derive(Debug, Clone, Deserialize)]