Fixed incorrect image size and clearing screen for AKP03R (#30)

* Fixed incorrect image size for AKP03R

* Fixed clearing screen
This commit is contained in:
Andrey Viktorov authored and GitHub committed 2025-02-10 08:28:03 +00:00
1 parent 9db52f16df
commit f0e4cf7f64
2 files changed
+13 -3

No files matched your search

+1 -1
View File
@@ -302,7 +302,7 @@ impl Kind {
Kind::Akp03R => ImageFormat {
mode: ImageMode::JPEG,
size: (64, 64),
size: (60, 60),
rotation: ImageRotation::Rot0,
mirror: ImageMirroring::None,
},
+12 -2
View File
@@ -318,7 +318,7 @@ impl StreamDeck {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => {
self.set_brightness(100)?;
self.clear_button_image(0xff)?;
self.clear_all_button_images()?;
Ok(())
}
@@ -592,7 +592,17 @@ impl StreamDeck {
pub fn clear_all_button_images(&self) -> Result<(), StreamDeckError> {
self.initialize()?;
match self.kind {
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::Akp03R | Kind::MiraBoxHSV293S => self.clear_button_image(0xff),
Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::MiraBoxHSV293S => self.clear_button_image(0xff),
Kind::Akp03R => {
self.clear_button_image(0xFF)?;
// Akp03R requires STP to commit clearing the screen
let mut buf = vec![0x00, 0x43, 0x52, 0x54, 0x00, 0x00, 0x53, 0x54, 0x50];
ajazz_extend_packet(&self.kind, &mut buf);
write_data(&self.device, buf.as_slice())?;
Ok(())
}
_ => {
for i in 0..self.kind.key_count() {
self.clear_button_image(i)?