-
Notifications
You must be signed in to change notification settings - Fork 26
Support Stream Deck Module #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Main commands are now implemented. There are some missing commands that original did not have:
I guess we can ignore these commands for now, or maybe implement them using different struct that implements /// StreamDeck object
pub struct StreamDeck {
kind: Kind,
device: HidDevice,
}
// current implemention
pub trait StreamDeckHandler {
pub fn connect(vid: u16, pid: u16, serial: Option<String>) -> Result<StreamDeck, Error>
pub fn connect_with_hid(api: &HidApi, vid: u16, pid: u16, serial: Option<String>) -> Result<StreamDeck, Error>
// ...
}
impl StreamDeckHandler for StreamDeckPlus {
// impl same as before
}
// This implements StreamDeckHandler + additional Module commands...
pub trait StreamDeckModuleHandler: StreamDeckHandler {
pub fn get_unit_information(&mut self) -> Result<String, Error>
}
impl StreamDeckModuleHandler for StreamDeckModule6Keys {
// impl original+module-expanded commands
} |
|
|
||
| use image::codecs::jpeg::JpegEncoder; | ||
| use image::io::Reader; | ||
| use image::ImageReader; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image::io::Reader is deprecated: https://docs.rs/image/latest/image/io/type.Reader.html
| pub const MODULE_6_KEYS: u16 = 0x00B8; | ||
| pub const MODULE_15_KEYS: u16 = 0x00B9; | ||
| pub const MODULE_32_KEYS: u16 = 0x00BA; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refer to official document:
https://docs.elgato.com/streamdeck/hid/module-6#summary
https://docs.elgato.com/streamdeck/hid/module-15_32#summary
| // Module devices does not support reset command | ||
| if self.kind().is_module() { | ||
| return Ok(()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Module series does not support reset command. However, maybe we could add "Cleanup" here:
https://docs.elgato.com/streamdeck/hid/module-6#closing-connection
https://docs.elgato.com/streamdeck/hid/module-6#show-logo
https://docs.elgato.com/streamdeck/hid/module-15_32#closing-connection
https://docs.elgato.com/streamdeck/hid/module-15_32#show-logo
Hello. I made a Stream Deck Module series implemention based on official document.
Still WIP but I'll make it done quick(I think)