moved TallyID into it's own file

Tally id now ignores tha case since it's basicly a hex value as a
string. Reason for that is that if a user inputs an id.
This commit is contained in:
2025-05-12 21:35:20 +02:00
parent b6b66a7e5b
commit 47f19f3c54
3 changed files with 50 additions and 12 deletions

View File

@@ -1,11 +1,12 @@
use buzzer::GPIOBuzzer;
use id_store::{IDStore, TallyID};
use id_store::IDStore;
use led::Led;
use log::{LevelFilter, debug, error, info, warn};
use pm3::run_pm3;
use rppal::pwm::Channel;
use simplelog::{ConfigBuilder, SimpleLogger};
use std::{env, error::Error, sync::Arc};
use tally_id::TallyID;
use tokio::{
fs,
sync::{Mutex, mpsc},
@@ -19,6 +20,7 @@ mod id_store;
mod led;
mod parser;
mod pm3;
mod tally_id;
mod webserver;
const STORE_PATH: &str = "./data.json";
@@ -92,7 +94,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
let channel_store = store.clone();
tokio::spawn(async move {
while let Some(tally_id_string) = rx.recv().await {
let tally_id = id_store::TallyID(tally_id_string);
let tally_id = TallyID(tally_id_string);
if hotspot_ids.contains(&tally_id) {
info!("Enableing hotspot");