clear image instead of shutting down the device

This commit is contained in:
Fl1tzi 2023-09-05 20:35:03 +02:00
parent 41420d3080
commit 2b9daeb220
No known key found for this signature in database
GPG key ID: 06B333727810C686
2 changed files with 14 additions and 1 deletions

View file

@ -192,7 +192,9 @@ impl Device {
self.selected_space = Some(name)
}
self.drop();
self.device.reset().await.unwrap();
for key in 0..self.device.kind().key_count() {
self.device.clear_button_image(key).await.unwrap();
}
self.init_modules().await;
}

11
src/helper.rs Normal file
View file

@ -0,0 +1,11 @@
// various functions useful for internal parsing or other things
/// Error for any kind of parsing
pub enum ParseError {
/// Generic error -> something is wrong
UnexpectedValue
}
pub fn hex_to_rgb(hex: String) -> Result<image::Rgb<u8>, ParseError> {
}