mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Create AniMe device only if physical device exists
The call to create the device handler will return with an error if the physical device doesn't exist, the device (if exists) is stored in an option already so just keep that as `None` if errored. Addresses issue #14
This commit is contained in:
@@ -69,8 +69,10 @@ pub async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
||||
// Possible Animatrix
|
||||
let mut animatrix_writer = None;
|
||||
if laptop.support_animatrix() {
|
||||
animatrix_writer = Some(AniMeWriter::new()?);
|
||||
info!("Device has an AniMe Matrix display");
|
||||
if let Ok(dev) = AniMeWriter::new() {
|
||||
animatrix_writer = Some(dev);
|
||||
info!("Device has an AniMe Matrix display");
|
||||
}
|
||||
}
|
||||
|
||||
// Set up the mutexes
|
||||
|
||||
Reference in New Issue
Block a user