diff --git a/charge-controller-supervisor/src/controller.rs b/charge-controller-supervisor/src/controller.rs index c89da12..f24aeae 100644 --- a/charge-controller-supervisor/src/controller.rs +++ b/charge-controller-supervisor/src/controller.rs @@ -1,3 +1,6 @@ +mod pl; +mod tristar; + pub struct Controller { name: String, interval: std::time::Duration, @@ -28,13 +31,13 @@ impl Controller { )> { let inner = match config.variant { crate::config::ChargeControllerVariant::Tristar => ControllerInner::Tristar( - crate::tristar::Tristar::new(&config.name, &config.transport).await?, + tristar::Tristar::new(&config.name, &config.transport).await?, ), crate::config::ChargeControllerVariant::Pl { timeout_milliseconds, } => match &config.transport { crate::config::Transport::Serial { port, baud_rate } => ControllerInner::Pl( - crate::pl::Pli::new(port, &config.name, *baud_rate, timeout_milliseconds)?, + pl::Pli::new(port, &config.name, *baud_rate, timeout_milliseconds)?, ), crate::config::Transport::Tcp { ip: _, port: _ } => { return Err(eyre::eyre!("pl doesn't support tcp")) @@ -138,8 +141,8 @@ impl MultiTx { } pub enum ControllerInner { - Pl(crate::pl::Pli), - Tristar(crate::tristar::Tristar), + Pl(pl::Pli), + Tristar(tristar::Tristar), } impl ControllerInner { diff --git a/charge-controller-supervisor/src/pl.rs b/charge-controller-supervisor/src/controller/pl.rs similarity index 100% rename from charge-controller-supervisor/src/pl.rs rename to charge-controller-supervisor/src/controller/pl.rs diff --git a/charge-controller-supervisor/src/tristar.rs b/charge-controller-supervisor/src/controller/tristar.rs similarity index 100% rename from charge-controller-supervisor/src/tristar.rs rename to charge-controller-supervisor/src/controller/tristar.rs diff --git a/charge-controller-supervisor/src/main.rs b/charge-controller-supervisor/src/main.rs index fc0c4db..2748c57 100644 --- a/charge-controller-supervisor/src/main.rs +++ b/charge-controller-supervisor/src/main.rs @@ -25,8 +25,6 @@ enum Commands { mod controller; mod gauges; -mod pl; -mod tristar; mod web;