diff --git a/src/app.rs b/src/app.rs index 1ca2ba3..8c70cdd 100644 --- a/src/app.rs +++ b/src/app.rs @@ -41,6 +41,9 @@ pub fn match_to_app(text: String) -> ActiveApp { Some("Pandora") => ActiveApp::Pandora, Some("Spotify") => ActiveApp::Spotify, Some("Plex") => ActiveApp::Plex, + Some("Crunchyroll") => ActiveApp::Crunchyroll, + Some("Funimation") => ActiveApp::Funimation, + Some("VRV") => ActiveApp::VRV, _ => ActiveApp::Nothing, } } diff --git a/src/config.rs b/src/config.rs index 11a8786..3ba16c2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -21,10 +21,6 @@ impl Configuration { self.active_app == self.get_app_status() } - pub fn is_change_power(&self) -> bool { - self.power_status == self.get_power_status() - } - pub fn change_active_app(&mut self, app_text: &String) { self.active_app = app_text.to_string(); } diff --git a/src/main.rs b/src/main.rs index a72fd62..a681d70 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,7 +23,6 @@ fn main() { loop { println!("{:?}", configuration); - let power_text = configuration.get_power_status(); configuration.change_power(&power_text); let tvpower = app::match_to_power_status(power_text); @@ -67,13 +66,37 @@ fn main() { ws.write(brightness(data.iter().cloned(), 32)) .unwrap(); }, - app::ActiveApp::AmazonPrime => println!("The light are light blue!"), + app::ActiveApp::AmazonPrime => { + let data = change_color(&99, &123, &255); + ws.write(brightness(data.iter().cloned(), 32)) + .unwrap(); + }, + app::ActiveApp::Pandora => { + let data = change_color(&99, &123, &255); + ws.write(brightness(data.iter().cloned(), 32)) + .unwrap(); + }, app::ActiveApp::Spotify => { let data = change_color(&51, &255, &85); ws.write(brightness(data.iter().cloned(), 32)) .unwrap(); }, app::ActiveApp::Plex => { + let data = change_color(&255, &187, &51); + ws.write(brightness(data.iter().cloned(), 32)) + .unwrap(); + }, + app::ActiveApp::Crunchyroll => { + let data = change_color(&255, &187, &51); + ws.write(brightness(data.iter().cloned(), 32)) + .unwrap(); + }, + app::ActiveApp::Funimation => { + let data = change_color(&255, &0, &255); + ws.write(brightness(data.iter().cloned(), 32)) + .unwrap(); + }, + app::ActiveApp::VRV => { let data = change_color(&255, &187, &51); ws.write(brightness(data.iter().cloned(), 32)) .unwrap(); @@ -82,7 +105,6 @@ fn main() { } } }, - _ => println!("We don't know what the power status of the TV is..."), } let sec = time::Duration::from_secs(1);