pub struct AsyncStreamDeck { /* private fields */ }async only.Expand description
Stream Deck interface suitable to be used in async, uses block_in_place so this wrapper cannot be used in current_thread runtimes
Implementations§
Source§impl AsyncStreamDeck
Static functions of the struct
impl AsyncStreamDeck
Static functions of the struct
Sourcepub fn connect(
hidapi: &HidApi,
kind: Kind,
serial: &str,
) -> Result<AsyncStreamDeck, StreamDeckError>
pub fn connect( hidapi: &HidApi, kind: Kind, serial: &str, ) -> Result<AsyncStreamDeck, StreamDeckError>
Attempts to connect to the device, can be safely ran inside multi_thread runtime
Source§impl AsyncStreamDeck
Instance methods of the struct
impl AsyncStreamDeck
Instance methods of the struct
Sourcepub async fn manufacturer(&self) -> Result<String, StreamDeckError>
pub async fn manufacturer(&self) -> Result<String, StreamDeckError>
Returns manufacturer string of the device
Sourcepub async fn product(&self) -> Result<String, StreamDeckError>
pub async fn product(&self) -> Result<String, StreamDeckError>
Returns product string of the device
Sourcepub async fn serial_number(&self) -> Result<String, StreamDeckError>
pub async fn serial_number(&self) -> Result<String, StreamDeckError>
Returns serial number of the device
Sourcepub async fn firmware_version(&self) -> Result<String, StreamDeckError>
pub async fn firmware_version(&self) -> Result<String, StreamDeckError>
Returns firmware version of the StreamDeck
Sourcepub async fn read_input(
&self,
poll_rate: f32,
) -> Result<StreamDeckInput, StreamDeckError>
pub async fn read_input( &self, poll_rate: f32, ) -> Result<StreamDeckInput, StreamDeckError>
Reads button states, awaits until there’s data. Poll rate determines how often button state gets checked
Sourcepub async fn reset(&self) -> Result<(), StreamDeckError>
pub async fn reset(&self) -> Result<(), StreamDeckError>
Resets the device
Sourcepub async fn set_brightness(&self, percent: u8) -> Result<(), StreamDeckError>
pub async fn set_brightness(&self, percent: u8) -> Result<(), StreamDeckError>
Sets brightness of the device, value range is 0 - 100
Sourcepub async fn write_image(
&self,
key: u8,
image_data: &[u8],
) -> Result<(), StreamDeckError>
pub async fn write_image( &self, key: u8, image_data: &[u8], ) -> Result<(), StreamDeckError>
Writes image data to Stream Deck device, changes must be flushed with .flush() before
they will appear on the device!
Sourcepub async fn write_lcd(
&self,
x: u16,
y: u16,
rect: &ImageRect,
) -> Result<(), StreamDeckError>
pub async fn write_lcd( &self, x: u16, y: u16, rect: &ImageRect, ) -> Result<(), StreamDeckError>
Writes image data to Stream Deck device’s lcd strip/screen as region. Only Stream Deck Plus supports writing LCD regions, for Stream Deck Neo use write_lcd_fill
Sourcepub async fn write_lcd_fill(
&self,
image_data: &[u8],
) -> Result<(), StreamDeckError>
pub async fn write_lcd_fill( &self, image_data: &[u8], ) -> Result<(), StreamDeckError>
Writes image data to Stream Deck device’s lcd strip/screen as full fill
You can convert your images into proper image_data like this:
use elgato_streamdeck::images::{convert_image_with_format_async};
let image_data = convert_image_with_format_async(device.kind().lcd_image_format(), image).await.unwrap();
device.write_lcd_fill(&image_data).await;Sets button’s image to blank, changes must be flushed with .flush() before
they will appear on the device!
Sets blank images to every button, changes must be flushed with .flush() before
they will appear on the device!
Sets specified button’s image, changes must be flushed with .flush() before
they will appear on the device!
Sourcepub async fn set_logo_image(
&self,
image: DynamicImage,
) -> Result<(), StreamDeckError>
pub async fn set_logo_image( &self, image: DynamicImage, ) -> Result<(), StreamDeckError>
Set logo image
Sourcepub async fn set_touchpoint_color(
&self,
point: u8,
red: u8,
green: u8,
blue: u8,
) -> Result<(), StreamDeckError>
pub async fn set_touchpoint_color( &self, point: u8, red: u8, green: u8, blue: u8, ) -> Result<(), StreamDeckError>
Sets specified touch point’s led strip color
Sourcepub async fn sleep(&self) -> Result<(), StreamDeckError>
pub async fn sleep(&self) -> Result<(), StreamDeckError>
Sleeps the device
Sourcepub async fn keep_alive(&self) -> Result<(), StreamDeckError>
pub async fn keep_alive(&self) -> Result<(), StreamDeckError>
Make periodic events to the device, to keep it alive
Sourcepub async fn shutdown(&self) -> Result<(), StreamDeckError>
pub async fn shutdown(&self) -> Result<(), StreamDeckError>
Shutdown the device
Sourcepub async fn flush(&self) -> Result<(), StreamDeckError>
pub async fn flush(&self) -> Result<(), StreamDeckError>
Flushes the button’s image to the device
Sourcepub fn get_reader(&self) -> Arc<AsyncDeviceStateReader>
pub fn get_reader(&self) -> Arc<AsyncDeviceStateReader>
Returns button state reader for this device
Trait Implementations§
Source§impl Clone for AsyncStreamDeck
impl Clone for AsyncStreamDeck
Source§fn clone(&self) -> AsyncStreamDeck
fn clone(&self) -> AsyncStreamDeck
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more