docs » 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 module would not have been possible without standing on the shoulders of others:

API Overview

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 Streaming 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
Returns
  • None

getDevice

Signature hs.streamdeck.getDevice(num)
Type Function
Description Gets an hs.streamdeck object for the specified device
Parameters
  • num - A number that should be within the bounds of the number of connected devices
Returns
  • An hs.streamdeck object

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 Streaming 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
Returns
  • None
Notes
  • This function must be called before any other parts of this module are used

numDevices

Signature hs.streamdeck.numDevices()
Type Function
Description Gets the number of Stream Deck devices connected
Parameters
  • None
Returns
  • A number containing the number of Stream Deck devices attached to the system

Methods

buttonCallback

Signature hs.streamdeck:buttonCallback(fn)
Type Method
Description Sets/clears the button callback function for a deck
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)
Returns
  • The hs.streamdeck device

firmwareVersion

Signature hs.streamdeck:firmwareVersion()
Type Method
Description Gets the firmware version of a deck
Parameters
  • None
Returns
  • A string containing the firmware version of the deck

reset

Signature hs.streamdeck:reset()
Type Method
Description Resets a deck
Parameters
  • None
Returns
  • The hs.streamdec object

serialNumber

Signature hs.streamdeck:serialNumber()
Type Method
Description Gets the serial number of a deck
Parameters
  • None
Returns
  • A string containing the serial number of the deck

setBrightness

Signature hs.streamdeck:setBrightness(brightness)
Type Method
Description Sets the brightness of a deck
Parameters
  • brightness - A whole number between 0 and 100 indicating the percentage brightness level to set
Returns
  • The hs.streamdeck device

setButtonColor

Signature hs.streamdeck:setButtonColor(button, color)
Type Method
Description Sets a button on the deck to the specified color
Parameters
  • button - A number (from 1 to 15) describing which button to set the color on
  • color - An hs.drawing.color object
Returns
  • The hs.streamdeck object

setButtonImage

Signature hs.streamdeck:setButtonImage(button, image)
Type Method
Description Sets the image of a button on the deck
Parameters
  • button - A number (from 1 to 15) describing which button to set the image for
  • image - An hs.image object
Returns
  • The hs.streamdeck object

results matching ""

    No results matching ""