Skip to content

Latest commit

 

History

History
122 lines (103 loc) · 12.3 KB

hs.streamdeck.md

File metadata and controls

122 lines (103 loc) · 12.3 KB

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

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
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
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
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

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
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
Signature hs.streamdeck:reset()
Type Method
Description Resets a deck
Parameters
  • None
Returns
  • The hs.streamdec object
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
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
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
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