#
hs.streamdeck
Configure/control an Elgato Stream Deck.
Please note that in order for this module to work, the official Elgato Stream Deck app should not be running.
This extension supports the following devices:
- Stream Deck (Original)
- Stream Deck (Original V2)
- Stream Deck Plus
- Stream Deck Mini
- Stream Deck Mini (V2)
- Stream Deck XL
- Stream Deck XL (Mk2)
- Stream Deck Pedal
This module would not have been possible without standing on the shoulders of others:
- https://github.com/OpenStreamDeck/StreamDeckSharp
- https://github.com/Lange/node-elgato-stream-deck
- Hopper
#
API Overview
Functions - API calls offered directly by the extension
discoveryCallback getDevice init numDevices
Methods - API calls which can only be made on an object returned by a constructor
buttonCallback buttonLayout encoderCallback firmwareVersion imageSize reset screenCallback serialNumber setBrightness setButtonColor setButtonImage setScreenImage
#
API Documentation
#
Functions
#
discoveryCallback
| | |
| --------------------------------------------|-------------------------------------------------------------------------------------|
| Signature | hs.streamdeck.discoveryCallback(fn)
|
| Type | Function |
| Description | Sets/clears a callback for reacting to device discovery events |
| Parameters |
- fn - A function that will be called when a Stream Deck is connected or disconnected. It should take the following arguments: A boolean, true if a device was connected, false if a device was disconnected An hs.streamdeck object, being the device that was connected/disconnected
- None
#
getDevice
#
init
| | |
| --------------------------------------------|-------------------------------------------------------------------------------------|
| Signature | hs.streamdeck.init(fn)
|
| Type | Function |
| Description | Initialises the Stream Deck driver and sets a discovery callback |
| Parameters |
- fn - A function that will be called when a Stream Deck is connected or disconnected. It should take the following arguments: A boolean, true if a device was connected, false if a device was disconnected An hs.streamdeck object, being the device that was connected/disconnected
- None
- This function must be called before any other parts of this module are used
#
numDevices
#
Methods
#
buttonCallback
| | |
| --------------------------------------------|-------------------------------------------------------------------------------------|
| Signature | hs.streamdeck:buttonCallback(fn)
|
| Type | Method |
| Description | Sets/clears the button callback function for a Stream Deck device |
| Parameters |
- fn - A function to be called when a button is pressed/released on the stream deck. It should receive three arguments: The hs.streamdeck userdata object A number containing the button that was pressed/released A boolean indicating whether the button was pressed (true) or released (false)
- The hs.streamdeck device
#
buttonLayout
#
encoderCallback
| | |
| --------------------------------------------|-------------------------------------------------------------------------------------|
| Signature | hs.streamdeck:encoderCallback(fn)
|
| Type | Method |
| Description | Sets/clears the knob/encoder callback function for a Stream Deck Plus. |
| Parameters |
- fn - A function to be called when an encoder button is pressed/released/rotated on a Stream Deck Plus. It should receive five arguments: The hs.streamdeck userdata object A number containing the button that was pressed/released/rotated A boolean indicating whether the button was pressed (true) or released (false) A boolean indicating that the button was turned left A boolean indicating that the button was turned right
- The hs.streamdeck device
#
firmwareVersion
#
imageSize
#
reset
#
screenCallback
| | |
| --------------------------------------------|-------------------------------------------------------------------------------------|
| Signature | hs.streamdeck:screenCallback(fn)
|
| Type | Method |
| Description | Sets/clears the screen callback function for a Stream Deck Plus's touch screen (above the encoder knobs). |
| Parameters |
- fn - A function to be called when a screen is pressed/released/swiped on a Stream Deck Plus. It should receive six arguments: The hs.streamdeck userdata object A string either containing "shortPress", "longPress" or "swipe" The X position of where the screen was first touched The Y position of where the screen was first touched The X position of where the screen was last touched (if swiping) The Y position of where the screen was last touched (if swiping)
- The hs.streamdeck device