Outdoor chime filename as global constant

This commit is contained in:
2020-10-28 18:22:47 -07:00
parent 743d5f231c
commit 941038eece

View File

@@ -12,6 +12,7 @@ use tokio::{ sync::mpsc,
time::interval }; time::interval };
use warp::{Filter, sse, sse::ServerSentEvent}; use warp::{Filter, sse, sse::ServerSentEvent};
const OUTDOOR_CHIME_FILE: &str = "static/outdoor.mp3";
const BUTTON_PIN: u8 = 26; const BUTTON_PIN: u8 = 26;
@@ -70,7 +71,7 @@ async fn main() {
} }
debug!("Playing doorbell chime"); debug!("Playing doorbell chime");
match process::Command::new("mplayer") match process::Command::new("mplayer")
.arg("static/outdoor.mp3") .arg(OUTDOOR_CHIME_FILE)
.stdout(process::Stdio::null()) .stdout(process::Stdio::null())
.stderr(process::Stdio::null()) .stderr(process::Stdio::null())
.spawn() { .spawn() {