Skip to content

Repository files navigation

Module chess-streamdeck

Integration with Elgato StreamDeck.

This is a fork of erh:viam-streamdeck that adds response-driven page switching: when a key press or dial turn issues a DoCommand to another component, the Stream Deck waits for the response and, if it contains a "mode" field, automatically switches to the page named by that value. See Response-driven page switching.

attributes

simple-config

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"key": 0,
"color" : "purple",
"component": "foo",
"method": "do_command",
"args": [ {
"x ": 1
} ]
}
]
}

choose a font

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"text_font": "NotoEmoji-Regular.tff"
}
]
}

Currently only NotoEmoji-Regular.tff is included with the module. You can load additional fonts as an asset if desired. Note that rendering is limited to a small character set within hte font. This is a known limitation of the freetype library's DrawString() method that is used. Cahracters outside the Basic Multilingual Plane (BMP) (characters above U+FFFF) cannot be rendered. If this is needed, use images instead.

adding images and font assets

{
"brightness":100,
"assets":{
"fonts":[
"/absolute/path/to/custom-font.ttf",
"/Users/yourname/.fonts"
],
"images":[
"/absolute/path/to/custom-image.jpg",
"/Users/yourname/images"
]
},
"keys":[
{
"key":0,
"component":"my-component",
"method":"do_command",
"text":"Custom",
"text_font":"custom-font.ttf",
"image":"logo.png"
}
]
}

You can add your own external fonts and images to use througout your configuration. Fonts must be in .ttf or .otf. Images can be .jpg, .jpeg, .png or .gif. Images stopsign.jpg and x.jpg is included and can also be used without an external asset.

DoCommand: update_display

The update_display DoCommand allows you to dynamically update the Stream Deck display at runtime. This is useful for changing key appearances, updating brightness, or modifying dial configurations without restarting the component.

Updating Brightness

{
"update_display": {
"brightness": 75
}
}

Changes the Stream Deck brightness to 75% (accepts values 0-100).

Updating Keys

You can update individual keys by specifying the key number and the properties to change. The update merges with the existing configuration, so you only need to specify the properties you want to change.

{
"update_display": {
"keys": {
"0": {
"text": "New Text",
"color": "blue"
},
"1": {
"text": "Status: OK",
"text_color": "green",
"image": "checkmark.png"
}
}
}
}

Available key properties:

  • text - Text to display on the key
  • text_color - Color of the text (e.g., "red", "blue", "#FF0000")
  • color - Background color of the key
  • image - Image file to display (must be in assets)
  • component - Component to call when key is pressed
  • method - Method to call on the component
  • args - Array of arguments to pass to the method

Updating Dials

For Stream Decks with dials (like the Stream Deck+), you can update dial configurations:

{
"update_display": {
"dials": {
"0": {
"component": "my-motor",
"command": "set_power"
}
}
}
}

Available dial properties:

  • component - Component to call when dial is turned
  • command - Command to execute on the component

Dial example

{
"dials": [
{
"dial": 0,
"component": "foo",
"command": "SetPosition"
}
]
}

Combining Updates

You can update multiple aspects in a single DoCommand:

{
"update_display": {
"brightness": 80,
"keys": {
"0": {
"text": "Active",
"color": "green"
},
"2": {
"text": "Inactive",
"color": "gray"
}
},
"dials": {
"0": {
"component": "volume-control",
"command": "set_level"
}
}
}
}

Response

The DoCommand returns a map indicating what was updated:

{
"brightness": 80,
"keys": [0, 2],
"dials": [0]
}

Self-Referencing Keys

Keys can reference the Stream Deck component itself by using the component's own name. This allows keys to trigger DoCommands that update the display dynamically:

{
"keys": [
{
"key": 0,
"text": "Toggle",
"component": "my-streamdeck",
"method": "do_command",
"args": [
{
"update_display": {
"keys": {
"1": {
"text": "Updated!",
"color": "yellow"
}
}
}
}
]
}
]
}

Pages

Instead of a flat list of keys, you can organize keys into named pages and switch between them at runtime using set_page. Use initial_page to set which page is displayed on startup. Keys can navigate between pages by referencing the Stream Deck component itself and calling set_page.

{
"brightness": 100,
"initial_page": "main",
"pages": {
"main": [
{
"key": 0,
"text": "Go to other",
"color": "blue",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "other" }]
},
{
"key": 1,
"text": "Hello",
"component": "foo",
"method": "do_command",
"args": [{ "x": 1 }]
}
],
"other": [
{
"key": 0,
"text": "Back",
"color": "red",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "main" }]
},
{
"key": 1,
"text": "Do thing",
"component": "bar",
"method": "do_command",
"args": [{ "y": 2 }]
}
]
}
}

You cannot use keys and pages at the same time.

Response-driven page switching

When a key (do_command) or dial (DoCommand) sends a command to another component, the Stream Deck waits for the response and inspects it for a "mode" field. If present and a non-empty string, the deck switches to the page of that name — exactly as if set_page had been called on itself.

This lets a separate module own the navigation logic: the deck sends it a command, the module decides what should be shown next, and replies with the page to display.

{
"brightness": 100,
"initial_page": "menu",
"pages": {
"menu": [
{
"key": 0,
"text": "Play",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "start_game" }]
}
],
"board": [
{
"key": 0,
"text": "Resign",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "resign" }]
}
]
}
}

In the example above, pressing Play sends {"action": "start_game"} to the chess-logic component. If chess-logic replies with {"mode": "board"}, the deck automatically switches to the board page.

Behavior notes:

  • The check is automatic for every do_command key and dial — no extra config flag.
  • If the response has no "mode" field (or it is not a non-empty string), nothing changes.
  • If "mode" names a page that does not exist, or the config uses flat keys instead of pages, a warning is logged and the button press is still considered successful.

pickup

This is a simple streamdeck app for picking things up

{
"brightness" : 100, // optional, 0 -> 100"arm" : "...",
"gripper" : "...",
"finder" : "...", // vision service that supports GetObjectPointClouds"motion" : "...", // motion service, could be 'builtin'"watch_pose" : "...", // an arm-saver position from where to watch
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - viam-modules/chess-streamdeck · GitHub
Skip to content

Repository files navigation

Module chess-streamdeck

Integration with Elgato StreamDeck.

This is a fork of erh:viam-streamdeck that adds response-driven page switching: when a key press or dial turn issues a DoCommand to another component, the Stream Deck waits for the response and, if it contains a "mode" field, automatically switches to the page named by that value. See Response-driven page switching.

attributes

simple-config

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"key": 0,
"color" : "purple",
"component": "foo",
"method": "do_command",
"args": [ {
"x ": 1
} ]
}
]
}

choose a font

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"text_font": "NotoEmoji-Regular.tff"
}
]
}

Currently only NotoEmoji-Regular.tff is included with the module. You can load additional fonts as an asset if desired. Note that rendering is limited to a small character set within hte font. This is a known limitation of the freetype library's DrawString() method that is used. Cahracters outside the Basic Multilingual Plane (BMP) (characters above U+FFFF) cannot be rendered. If this is needed, use images instead.

adding images and font assets

{
"brightness":100,
"assets":{
"fonts":[
"/absolute/path/to/custom-font.ttf",
"/Users/yourname/.fonts"
],
"images":[
"/absolute/path/to/custom-image.jpg",
"/Users/yourname/images"
]
},
"keys":[
{
"key":0,
"component":"my-component",
"method":"do_command",
"text":"Custom",
"text_font":"custom-font.ttf",
"image":"logo.png"
}
]
}

You can add your own external fonts and images to use througout your configuration. Fonts must be in .ttf or .otf. Images can be .jpg, .jpeg, .png or .gif. Images stopsign.jpg and x.jpg is included and can also be used without an external asset.

DoCommand: update_display

The update_display DoCommand allows you to dynamically update the Stream Deck display at runtime. This is useful for changing key appearances, updating brightness, or modifying dial configurations without restarting the component.

Updating Brightness

{
"update_display": {
"brightness": 75
}
}

Changes the Stream Deck brightness to 75% (accepts values 0-100).

Updating Keys

You can update individual keys by specifying the key number and the properties to change. The update merges with the existing configuration, so you only need to specify the properties you want to change.

{
"update_display": {
"keys": {
"0": {
"text": "New Text",
"color": "blue"
},
"1": {
"text": "Status: OK",
"text_color": "green",
"image": "checkmark.png"
}
}
}
}

Available key properties:

  • text - Text to display on the key
  • text_color - Color of the text (e.g., "red", "blue", "#FF0000")
  • color - Background color of the key
  • image - Image file to display (must be in assets)
  • component - Component to call when key is pressed
  • method - Method to call on the component
  • args - Array of arguments to pass to the method

Updating Dials

For Stream Decks with dials (like the Stream Deck+), you can update dial configurations:

{
"update_display": {
"dials": {
"0": {
"component": "my-motor",
"command": "set_power"
}
}
}
}

Available dial properties:

  • component - Component to call when dial is turned
  • command - Command to execute on the component

Dial example

{
"dials": [
{
"dial": 0,
"component": "foo",
"command": "SetPosition"
}
]
}

Combining Updates

You can update multiple aspects in a single DoCommand:

{
"update_display": {
"brightness": 80,
"keys": {
"0": {
"text": "Active",
"color": "green"
},
"2": {
"text": "Inactive",
"color": "gray"
}
},
"dials": {
"0": {
"component": "volume-control",
"command": "set_level"
}
}
}
}

Response

The DoCommand returns a map indicating what was updated:

{
"brightness": 80,
"keys": [0, 2],
"dials": [0]
}

Self-Referencing Keys

Keys can reference the Stream Deck component itself by using the component's own name. This allows keys to trigger DoCommands that update the display dynamically:

{
"keys": [
{
"key": 0,
"text": "Toggle",
"component": "my-streamdeck",
"method": "do_command",
"args": [
{
"update_display": {
"keys": {
"1": {
"text": "Updated!",
"color": "yellow"
}
}
}
}
]
}
]
}

Pages

Instead of a flat list of keys, you can organize keys into named pages and switch between them at runtime using set_page. Use initial_page to set which page is displayed on startup. Keys can navigate between pages by referencing the Stream Deck component itself and calling set_page.

{
"brightness": 100,
"initial_page": "main",
"pages": {
"main": [
{
"key": 0,
"text": "Go to other",
"color": "blue",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "other" }]
},
{
"key": 1,
"text": "Hello",
"component": "foo",
"method": "do_command",
"args": [{ "x": 1 }]
}
],
"other": [
{
"key": 0,
"text": "Back",
"color": "red",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "main" }]
},
{
"key": 1,
"text": "Do thing",
"component": "bar",
"method": "do_command",
"args": [{ "y": 2 }]
}
]
}
}

You cannot use keys and pages at the same time.

Response-driven page switching

When a key (do_command) or dial (DoCommand) sends a command to another component, the Stream Deck waits for the response and inspects it for a "mode" field. If present and a non-empty string, the deck switches to the page of that name — exactly as if set_page had been called on itself.

This lets a separate module own the navigation logic: the deck sends it a command, the module decides what should be shown next, and replies with the page to display.

{
"brightness": 100,
"initial_page": "menu",
"pages": {
"menu": [
{
"key": 0,
"text": "Play",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "start_game" }]
}
],
"board": [
{
"key": 0,
"text": "Resign",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "resign" }]
}
]
}
}

In the example above, pressing Play sends {"action": "start_game"} to the chess-logic component. If chess-logic replies with {"mode": "board"}, the deck automatically switches to the board page.

Behavior notes:

  • The check is automatic for every do_command key and dial — no extra config flag.
  • If the response has no "mode" field (or it is not a non-empty string), nothing changes.
  • If "mode" names a page that does not exist, or the config uses flat keys instead of pages, a warning is logged and the button press is still considered successful.

pickup

This is a simple streamdeck app for picking things up

{
"brightness" : 100, // optional, 0 -> 100"arm" : "...",
"gripper" : "...",
"finder" : "...", // vision service that supports GetObjectPointClouds"motion" : "...", // motion service, could be 'builtin'"watch_pose" : "...", // an arm-saver position from where to watch
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - viam-modules/chess-streamdeck · GitHub
Skip to content

Repository files navigation

Module chess-streamdeck

Integration with Elgato StreamDeck.

This is a fork of erh:viam-streamdeck that adds response-driven page switching: when a key press or dial turn issues a DoCommand to another component, the Stream Deck waits for the response and, if it contains a "mode" field, automatically switches to the page named by that value. See Response-driven page switching.

attributes

simple-config

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"key": 0,
"color" : "purple",
"component": "foo",
"method": "do_command",
"args": [ {
"x ": 1
} ]
}
]
}

choose a font

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"text_font": "NotoEmoji-Regular.tff"
}
]
}

Currently only NotoEmoji-Regular.tff is included with the module. You can load additional fonts as an asset if desired. Note that rendering is limited to a small character set within hte font. This is a known limitation of the freetype library's DrawString() method that is used. Cahracters outside the Basic Multilingual Plane (BMP) (characters above U+FFFF) cannot be rendered. If this is needed, use images instead.

adding images and font assets

{
"brightness":100,
"assets":{
"fonts":[
"/absolute/path/to/custom-font.ttf",
"/Users/yourname/.fonts"
],
"images":[
"/absolute/path/to/custom-image.jpg",
"/Users/yourname/images"
]
},
"keys":[
{
"key":0,
"component":"my-component",
"method":"do_command",
"text":"Custom",
"text_font":"custom-font.ttf",
"image":"logo.png"
}
]
}

You can add your own external fonts and images to use througout your configuration. Fonts must be in .ttf or .otf. Images can be .jpg, .jpeg, .png or .gif. Images stopsign.jpg and x.jpg is included and can also be used without an external asset.

DoCommand: update_display

The update_display DoCommand allows you to dynamically update the Stream Deck display at runtime. This is useful for changing key appearances, updating brightness, or modifying dial configurations without restarting the component.

Updating Brightness

{
"update_display": {
"brightness": 75
}
}

Changes the Stream Deck brightness to 75% (accepts values 0-100).

Updating Keys

You can update individual keys by specifying the key number and the properties to change. The update merges with the existing configuration, so you only need to specify the properties you want to change.

{
"update_display": {
"keys": {
"0": {
"text": "New Text",
"color": "blue"
},
"1": {
"text": "Status: OK",
"text_color": "green",
"image": "checkmark.png"
}
}
}
}

Available key properties:

  • text - Text to display on the key
  • text_color - Color of the text (e.g., "red", "blue", "#FF0000")
  • color - Background color of the key
  • image - Image file to display (must be in assets)
  • component - Component to call when key is pressed
  • method - Method to call on the component
  • args - Array of arguments to pass to the method

Updating Dials

For Stream Decks with dials (like the Stream Deck+), you can update dial configurations:

{
"update_display": {
"dials": {
"0": {
"component": "my-motor",
"command": "set_power"
}
}
}
}

Available dial properties:

  • component - Component to call when dial is turned
  • command - Command to execute on the component

Dial example

{
"dials": [
{
"dial": 0,
"component": "foo",
"command": "SetPosition"
}
]
}

Combining Updates

You can update multiple aspects in a single DoCommand:

{
"update_display": {
"brightness": 80,
"keys": {
"0": {
"text": "Active",
"color": "green"
},
"2": {
"text": "Inactive",
"color": "gray"
}
},
"dials": {
"0": {
"component": "volume-control",
"command": "set_level"
}
}
}
}

Response

The DoCommand returns a map indicating what was updated:

{
"brightness": 80,
"keys": [0, 2],
"dials": [0]
}

Self-Referencing Keys

Keys can reference the Stream Deck component itself by using the component's own name. This allows keys to trigger DoCommands that update the display dynamically:

{
"keys": [
{
"key": 0,
"text": "Toggle",
"component": "my-streamdeck",
"method": "do_command",
"args": [
{
"update_display": {
"keys": {
"1": {
"text": "Updated!",
"color": "yellow"
}
}
}
}
]
}
]
}

Pages

Instead of a flat list of keys, you can organize keys into named pages and switch between them at runtime using set_page. Use initial_page to set which page is displayed on startup. Keys can navigate between pages by referencing the Stream Deck component itself and calling set_page.

{
"brightness": 100,
"initial_page": "main",
"pages": {
"main": [
{
"key": 0,
"text": "Go to other",
"color": "blue",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "other" }]
},
{
"key": 1,
"text": "Hello",
"component": "foo",
"method": "do_command",
"args": [{ "x": 1 }]
}
],
"other": [
{
"key": 0,
"text": "Back",
"color": "red",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "main" }]
},
{
"key": 1,
"text": "Do thing",
"component": "bar",
"method": "do_command",
"args": [{ "y": 2 }]
}
]
}
}

You cannot use keys and pages at the same time.

Response-driven page switching

When a key (do_command) or dial (DoCommand) sends a command to another component, the Stream Deck waits for the response and inspects it for a "mode" field. If present and a non-empty string, the deck switches to the page of that name — exactly as if set_page had been called on itself.

This lets a separate module own the navigation logic: the deck sends it a command, the module decides what should be shown next, and replies with the page to display.

{
"brightness": 100,
"initial_page": "menu",
"pages": {
"menu": [
{
"key": 0,
"text": "Play",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "start_game" }]
}
],
"board": [
{
"key": 0,
"text": "Resign",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "resign" }]
}
]
}
}

In the example above, pressing Play sends {"action": "start_game"} to the chess-logic component. If chess-logic replies with {"mode": "board"}, the deck automatically switches to the board page.

Behavior notes:

  • The check is automatic for every do_command key and dial — no extra config flag.
  • If the response has no "mode" field (or it is not a non-empty string), nothing changes.
  • If "mode" names a page that does not exist, or the config uses flat keys instead of pages, a warning is logged and the button press is still considered successful.

pickup

This is a simple streamdeck app for picking things up

{
"brightness" : 100, // optional, 0 -> 100"arm" : "...",
"gripper" : "...",
"finder" : "...", // vision service that supports GetObjectPointClouds"motion" : "...", // motion service, could be 'builtin'"watch_pose" : "...", // an arm-saver position from where to watch
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - viam-modules/chess-streamdeck · GitHub
Skip to content

Repository files navigation

Module chess-streamdeck

Integration with Elgato StreamDeck.

This is a fork of erh:viam-streamdeck that adds response-driven page switching: when a key press or dial turn issues a DoCommand to another component, the Stream Deck waits for the response and, if it contains a "mode" field, automatically switches to the page named by that value. See Response-driven page switching.

attributes

simple-config

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"key": 0,
"color" : "purple",
"component": "foo",
"method": "do_command",
"args": [ {
"x ": 1
} ]
}
]
}

choose a font

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"text_font": "NotoEmoji-Regular.tff"
}
]
}

Currently only NotoEmoji-Regular.tff is included with the module. You can load additional fonts as an asset if desired. Note that rendering is limited to a small character set within hte font. This is a known limitation of the freetype library's DrawString() method that is used. Cahracters outside the Basic Multilingual Plane (BMP) (characters above U+FFFF) cannot be rendered. If this is needed, use images instead.

adding images and font assets

{
"brightness":100,
"assets":{
"fonts":[
"/absolute/path/to/custom-font.ttf",
"/Users/yourname/.fonts"
],
"images":[
"/absolute/path/to/custom-image.jpg",
"/Users/yourname/images"
]
},
"keys":[
{
"key":0,
"component":"my-component",
"method":"do_command",
"text":"Custom",
"text_font":"custom-font.ttf",
"image":"logo.png"
}
]
}

You can add your own external fonts and images to use througout your configuration. Fonts must be in .ttf or .otf. Images can be .jpg, .jpeg, .png or .gif. Images stopsign.jpg and x.jpg is included and can also be used without an external asset.

DoCommand: update_display

The update_display DoCommand allows you to dynamically update the Stream Deck display at runtime. This is useful for changing key appearances, updating brightness, or modifying dial configurations without restarting the component.

Updating Brightness

{
"update_display": {
"brightness": 75
}
}

Changes the Stream Deck brightness to 75% (accepts values 0-100).

Updating Keys

You can update individual keys by specifying the key number and the properties to change. The update merges with the existing configuration, so you only need to specify the properties you want to change.

{
"update_display": {
"keys": {
"0": {
"text": "New Text",
"color": "blue"
},
"1": {
"text": "Status: OK",
"text_color": "green",
"image": "checkmark.png"
}
}
}
}

Available key properties:

  • text - Text to display on the key
  • text_color - Color of the text (e.g., "red", "blue", "#FF0000")
  • color - Background color of the key
  • image - Image file to display (must be in assets)
  • component - Component to call when key is pressed
  • method - Method to call on the component
  • args - Array of arguments to pass to the method

Updating Dials

For Stream Decks with dials (like the Stream Deck+), you can update dial configurations:

{
"update_display": {
"dials": {
"0": {
"component": "my-motor",
"command": "set_power"
}
}
}
}

Available dial properties:

  • component - Component to call when dial is turned
  • command - Command to execute on the component

Dial example

{
"dials": [
{
"dial": 0,
"component": "foo",
"command": "SetPosition"
}
]
}

Combining Updates

You can update multiple aspects in a single DoCommand:

{
"update_display": {
"brightness": 80,
"keys": {
"0": {
"text": "Active",
"color": "green"
},
"2": {
"text": "Inactive",
"color": "gray"
}
},
"dials": {
"0": {
"component": "volume-control",
"command": "set_level"
}
}
}
}

Response

The DoCommand returns a map indicating what was updated:

{
"brightness": 80,
"keys": [0, 2],
"dials": [0]
}

Self-Referencing Keys

Keys can reference the Stream Deck component itself by using the component's own name. This allows keys to trigger DoCommands that update the display dynamically:

{
"keys": [
{
"key": 0,
"text": "Toggle",
"component": "my-streamdeck",
"method": "do_command",
"args": [
{
"update_display": {
"keys": {
"1": {
"text": "Updated!",
"color": "yellow"
}
}
}
}
]
}
]
}

Pages

Instead of a flat list of keys, you can organize keys into named pages and switch between them at runtime using set_page. Use initial_page to set which page is displayed on startup. Keys can navigate between pages by referencing the Stream Deck component itself and calling set_page.

{
"brightness": 100,
"initial_page": "main",
"pages": {
"main": [
{
"key": 0,
"text": "Go to other",
"color": "blue",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "other" }]
},
{
"key": 1,
"text": "Hello",
"component": "foo",
"method": "do_command",
"args": [{ "x": 1 }]
}
],
"other": [
{
"key": 0,
"text": "Back",
"color": "red",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "main" }]
},
{
"key": 1,
"text": "Do thing",
"component": "bar",
"method": "do_command",
"args": [{ "y": 2 }]
}
]
}
}

You cannot use keys and pages at the same time.

Response-driven page switching

When a key (do_command) or dial (DoCommand) sends a command to another component, the Stream Deck waits for the response and inspects it for a "mode" field. If present and a non-empty string, the deck switches to the page of that name — exactly as if set_page had been called on itself.

This lets a separate module own the navigation logic: the deck sends it a command, the module decides what should be shown next, and replies with the page to display.

{
"brightness": 100,
"initial_page": "menu",
"pages": {
"menu": [
{
"key": 0,
"text": "Play",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "start_game" }]
}
],
"board": [
{
"key": 0,
"text": "Resign",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "resign" }]
}
]
}
}

In the example above, pressing Play sends {"action": "start_game"} to the chess-logic component. If chess-logic replies with {"mode": "board"}, the deck automatically switches to the board page.

Behavior notes:

  • The check is automatic for every do_command key and dial — no extra config flag.
  • If the response has no "mode" field (or it is not a non-empty string), nothing changes.
  • If "mode" names a page that does not exist, or the config uses flat keys instead of pages, a warning is logged and the button press is still considered successful.

pickup

This is a simple streamdeck app for picking things up

{
"brightness" : 100, // optional, 0 -> 100"arm" : "...",
"gripper" : "...",
"finder" : "...", // vision service that supports GetObjectPointClouds"motion" : "...", // motion service, could be 'builtin'"watch_pose" : "...", // an arm-saver position from where to watch
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - viam-modules/chess-streamdeck · GitHub
Skip to content

Repository files navigation

Module chess-streamdeck

Integration with Elgato StreamDeck.

This is a fork of erh:viam-streamdeck that adds response-driven page switching: when a key press or dial turn issues a DoCommand to another component, the Stream Deck waits for the response and, if it contains a "mode" field, automatically switches to the page named by that value. See Response-driven page switching.

attributes

simple-config

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"key": 0,
"color" : "purple",
"component": "foo",
"method": "do_command",
"args": [ {
"x ": 1
} ]
}
]
}

choose a font

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"text_font": "NotoEmoji-Regular.tff"
}
]
}

Currently only NotoEmoji-Regular.tff is included with the module. You can load additional fonts as an asset if desired. Note that rendering is limited to a small character set within hte font. This is a known limitation of the freetype library's DrawString() method that is used. Cahracters outside the Basic Multilingual Plane (BMP) (characters above U+FFFF) cannot be rendered. If this is needed, use images instead.

adding images and font assets

{
"brightness":100,
"assets":{
"fonts":[
"/absolute/path/to/custom-font.ttf",
"/Users/yourname/.fonts"
],
"images":[
"/absolute/path/to/custom-image.jpg",
"/Users/yourname/images"
]
},
"keys":[
{
"key":0,
"component":"my-component",
"method":"do_command",
"text":"Custom",
"text_font":"custom-font.ttf",
"image":"logo.png"
}
]
}

You can add your own external fonts and images to use througout your configuration. Fonts must be in .ttf or .otf. Images can be .jpg, .jpeg, .png or .gif. Images stopsign.jpg and x.jpg is included and can also be used without an external asset.

DoCommand: update_display

The update_display DoCommand allows you to dynamically update the Stream Deck display at runtime. This is useful for changing key appearances, updating brightness, or modifying dial configurations without restarting the component.

Updating Brightness

{
"update_display": {
"brightness": 75
}
}

Changes the Stream Deck brightness to 75% (accepts values 0-100).

Updating Keys

You can update individual keys by specifying the key number and the properties to change. The update merges with the existing configuration, so you only need to specify the properties you want to change.

{
"update_display": {
"keys": {
"0": {
"text": "New Text",
"color": "blue"
},
"1": {
"text": "Status: OK",
"text_color": "green",
"image": "checkmark.png"
}
}
}
}

Available key properties:

  • text - Text to display on the key
  • text_color - Color of the text (e.g., "red", "blue", "#FF0000")
  • color - Background color of the key
  • image - Image file to display (must be in assets)
  • component - Component to call when key is pressed
  • method - Method to call on the component
  • args - Array of arguments to pass to the method

Updating Dials

For Stream Decks with dials (like the Stream Deck+), you can update dial configurations:

{
"update_display": {
"dials": {
"0": {
"component": "my-motor",
"command": "set_power"
}
}
}
}

Available dial properties:

  • component - Component to call when dial is turned
  • command - Command to execute on the component

Dial example

{
"dials": [
{
"dial": 0,
"component": "foo",
"command": "SetPosition"
}
]
}

Combining Updates

You can update multiple aspects in a single DoCommand:

{
"update_display": {
"brightness": 80,
"keys": {
"0": {
"text": "Active",
"color": "green"
},
"2": {
"text": "Inactive",
"color": "gray"
}
},
"dials": {
"0": {
"component": "volume-control",
"command": "set_level"
}
}
}
}

Response

The DoCommand returns a map indicating what was updated:

{
"brightness": 80,
"keys": [0, 2],
"dials": [0]
}

Self-Referencing Keys

Keys can reference the Stream Deck component itself by using the component's own name. This allows keys to trigger DoCommands that update the display dynamically:

{
"keys": [
{
"key": 0,
"text": "Toggle",
"component": "my-streamdeck",
"method": "do_command",
"args": [
{
"update_display": {
"keys": {
"1": {
"text": "Updated!",
"color": "yellow"
}
}
}
}
]
}
]
}

Pages

Instead of a flat list of keys, you can organize keys into named pages and switch between them at runtime using set_page. Use initial_page to set which page is displayed on startup. Keys can navigate between pages by referencing the Stream Deck component itself and calling set_page.

{
"brightness": 100,
"initial_page": "main",
"pages": {
"main": [
{
"key": 0,
"text": "Go to other",
"color": "blue",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "other" }]
},
{
"key": 1,
"text": "Hello",
"component": "foo",
"method": "do_command",
"args": [{ "x": 1 }]
}
],
"other": [
{
"key": 0,
"text": "Back",
"color": "red",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "main" }]
},
{
"key": 1,
"text": "Do thing",
"component": "bar",
"method": "do_command",
"args": [{ "y": 2 }]
}
]
}
}

You cannot use keys and pages at the same time.

Response-driven page switching

When a key (do_command) or dial (DoCommand) sends a command to another component, the Stream Deck waits for the response and inspects it for a "mode" field. If present and a non-empty string, the deck switches to the page of that name — exactly as if set_page had been called on itself.

This lets a separate module own the navigation logic: the deck sends it a command, the module decides what should be shown next, and replies with the page to display.

{
"brightness": 100,
"initial_page": "menu",
"pages": {
"menu": [
{
"key": 0,
"text": "Play",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "start_game" }]
}
],
"board": [
{
"key": 0,
"text": "Resign",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "resign" }]
}
]
}
}

In the example above, pressing Play sends {"action": "start_game"} to the chess-logic component. If chess-logic replies with {"mode": "board"}, the deck automatically switches to the board page.

Behavior notes:

  • The check is automatic for every do_command key and dial — no extra config flag.
  • If the response has no "mode" field (or it is not a non-empty string), nothing changes.
  • If "mode" names a page that does not exist, or the config uses flat keys instead of pages, a warning is logged and the button press is still considered successful.

pickup

This is a simple streamdeck app for picking things up

{
"brightness" : 100, // optional, 0 -> 100"arm" : "...",
"gripper" : "...",
"finder" : "...", // vision service that supports GetObjectPointClouds"motion" : "...", // motion service, could be 'builtin'"watch_pose" : "...", // an arm-saver position from where to watch
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - viam-modules/chess-streamdeck · GitHub
Skip to content

Repository files navigation

Module chess-streamdeck

Integration with Elgato StreamDeck.

This is a fork of erh:viam-streamdeck that adds response-driven page switching: when a key press or dial turn issues a DoCommand to another component, the Stream Deck waits for the response and, if it contains a "mode" field, automatically switches to the page named by that value. See Response-driven page switching.

attributes

simple-config

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"key": 0,
"color" : "purple",
"component": "foo",
"method": "do_command",
"args": [ {
"x ": 1
} ]
}
]
}

choose a font

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"text_font": "NotoEmoji-Regular.tff"
}
]
}

Currently only NotoEmoji-Regular.tff is included with the module. You can load additional fonts as an asset if desired. Note that rendering is limited to a small character set within hte font. This is a known limitation of the freetype library's DrawString() method that is used. Cahracters outside the Basic Multilingual Plane (BMP) (characters above U+FFFF) cannot be rendered. If this is needed, use images instead.

adding images and font assets

{
"brightness":100,
"assets":{
"fonts":[
"/absolute/path/to/custom-font.ttf",
"/Users/yourname/.fonts"
],
"images":[
"/absolute/path/to/custom-image.jpg",
"/Users/yourname/images"
]
},
"keys":[
{
"key":0,
"component":"my-component",
"method":"do_command",
"text":"Custom",
"text_font":"custom-font.ttf",
"image":"logo.png"
}
]
}

You can add your own external fonts and images to use througout your configuration. Fonts must be in .ttf or .otf. Images can be .jpg, .jpeg, .png or .gif. Images stopsign.jpg and x.jpg is included and can also be used without an external asset.

DoCommand: update_display

The update_display DoCommand allows you to dynamically update the Stream Deck display at runtime. This is useful for changing key appearances, updating brightness, or modifying dial configurations without restarting the component.

Updating Brightness

{
"update_display": {
"brightness": 75
}
}

Changes the Stream Deck brightness to 75% (accepts values 0-100).

Updating Keys

You can update individual keys by specifying the key number and the properties to change. The update merges with the existing configuration, so you only need to specify the properties you want to change.

{
"update_display": {
"keys": {
"0": {
"text": "New Text",
"color": "blue"
},
"1": {
"text": "Status: OK",
"text_color": "green",
"image": "checkmark.png"
}
}
}
}

Available key properties:

  • text - Text to display on the key
  • text_color - Color of the text (e.g., "red", "blue", "#FF0000")
  • color - Background color of the key
  • image - Image file to display (must be in assets)
  • component - Component to call when key is pressed
  • method - Method to call on the component
  • args - Array of arguments to pass to the method

Updating Dials

For Stream Decks with dials (like the Stream Deck+), you can update dial configurations:

{
"update_display": {
"dials": {
"0": {
"component": "my-motor",
"command": "set_power"
}
}
}
}

Available dial properties:

  • component - Component to call when dial is turned
  • command - Command to execute on the component

Dial example

{
"dials": [
{
"dial": 0,
"component": "foo",
"command": "SetPosition"
}
]
}

Combining Updates

You can update multiple aspects in a single DoCommand:

{
"update_display": {
"brightness": 80,
"keys": {
"0": {
"text": "Active",
"color": "green"
},
"2": {
"text": "Inactive",
"color": "gray"
}
},
"dials": {
"0": {
"component": "volume-control",
"command": "set_level"
}
}
}
}

Response

The DoCommand returns a map indicating what was updated:

{
"brightness": 80,
"keys": [0, 2],
"dials": [0]
}

Self-Referencing Keys

Keys can reference the Stream Deck component itself by using the component's own name. This allows keys to trigger DoCommands that update the display dynamically:

{
"keys": [
{
"key": 0,
"text": "Toggle",
"component": "my-streamdeck",
"method": "do_command",
"args": [
{
"update_display": {
"keys": {
"1": {
"text": "Updated!",
"color": "yellow"
}
}
}
}
]
}
]
}

Pages

Instead of a flat list of keys, you can organize keys into named pages and switch between them at runtime using set_page. Use initial_page to set which page is displayed on startup. Keys can navigate between pages by referencing the Stream Deck component itself and calling set_page.

{
"brightness": 100,
"initial_page": "main",
"pages": {
"main": [
{
"key": 0,
"text": "Go to other",
"color": "blue",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "other" }]
},
{
"key": 1,
"text": "Hello",
"component": "foo",
"method": "do_command",
"args": [{ "x": 1 }]
}
],
"other": [
{
"key": 0,
"text": "Back",
"color": "red",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "main" }]
},
{
"key": 1,
"text": "Do thing",
"component": "bar",
"method": "do_command",
"args": [{ "y": 2 }]
}
]
}
}

You cannot use keys and pages at the same time.

Response-driven page switching

When a key (do_command) or dial (DoCommand) sends a command to another component, the Stream Deck waits for the response and inspects it for a "mode" field. If present and a non-empty string, the deck switches to the page of that name — exactly as if set_page had been called on itself.

This lets a separate module own the navigation logic: the deck sends it a command, the module decides what should be shown next, and replies with the page to display.

{
"brightness": 100,
"initial_page": "menu",
"pages": {
"menu": [
{
"key": 0,
"text": "Play",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "start_game" }]
}
],
"board": [
{
"key": 0,
"text": "Resign",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "resign" }]
}
]
}
}

In the example above, pressing Play sends {"action": "start_game"} to the chess-logic component. If chess-logic replies with {"mode": "board"}, the deck automatically switches to the board page.

Behavior notes:

  • The check is automatic for every do_command key and dial — no extra config flag.
  • If the response has no "mode" field (or it is not a non-empty string), nothing changes.
  • If "mode" names a page that does not exist, or the config uses flat keys instead of pages, a warning is logged and the button press is still considered successful.

pickup

This is a simple streamdeck app for picking things up

{
"brightness" : 100, // optional, 0 -> 100"arm" : "...",
"gripper" : "...",
"finder" : "...", // vision service that supports GetObjectPointClouds"motion" : "...", // motion service, could be 'builtin'"watch_pose" : "...", // an arm-saver position from where to watch
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); GitHub - viam-modules/chess-streamdeck · GitHub
Skip to content

Repository files navigation

Module chess-streamdeck

Integration with Elgato StreamDeck.

This is a fork of erh:viam-streamdeck that adds response-driven page switching: when a key press or dial turn issues a DoCommand to another component, the Stream Deck waits for the response and, if it contains a "mode" field, automatically switches to the page named by that value. See Response-driven page switching.

attributes

simple-config

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"key": 0,
"color" : "purple",
"component": "foo",
"method": "do_command",
"args": [ {
"x ": 1
} ]
}
]
}

choose a font

{
"brightness" : 100, // 0 -> 100"keys": [
{
"text": "The",
"text_font": "NotoEmoji-Regular.tff"
}
]
}

Currently only NotoEmoji-Regular.tff is included with the module. You can load additional fonts as an asset if desired. Note that rendering is limited to a small character set within hte font. This is a known limitation of the freetype library's DrawString() method that is used. Cahracters outside the Basic Multilingual Plane (BMP) (characters above U+FFFF) cannot be rendered. If this is needed, use images instead.

adding images and font assets

{
"brightness":100,
"assets":{
"fonts":[
"/absolute/path/to/custom-font.ttf",
"/Users/yourname/.fonts"
],
"images":[
"/absolute/path/to/custom-image.jpg",
"/Users/yourname/images"
]
},
"keys":[
{
"key":0,
"component":"my-component",
"method":"do_command",
"text":"Custom",
"text_font":"custom-font.ttf",
"image":"logo.png"
}
]
}

You can add your own external fonts and images to use througout your configuration. Fonts must be in .ttf or .otf. Images can be .jpg, .jpeg, .png or .gif. Images stopsign.jpg and x.jpg is included and can also be used without an external asset.

DoCommand: update_display

The update_display DoCommand allows you to dynamically update the Stream Deck display at runtime. This is useful for changing key appearances, updating brightness, or modifying dial configurations without restarting the component.

Updating Brightness

{
"update_display": {
"brightness": 75
}
}

Changes the Stream Deck brightness to 75% (accepts values 0-100).

Updating Keys

You can update individual keys by specifying the key number and the properties to change. The update merges with the existing configuration, so you only need to specify the properties you want to change.

{
"update_display": {
"keys": {
"0": {
"text": "New Text",
"color": "blue"
},
"1": {
"text": "Status: OK",
"text_color": "green",
"image": "checkmark.png"
}
}
}
}

Available key properties:

  • text - Text to display on the key
  • text_color - Color of the text (e.g., "red", "blue", "#FF0000")
  • color - Background color of the key
  • image - Image file to display (must be in assets)
  • component - Component to call when key is pressed
  • method - Method to call on the component
  • args - Array of arguments to pass to the method

Updating Dials

For Stream Decks with dials (like the Stream Deck+), you can update dial configurations:

{
"update_display": {
"dials": {
"0": {
"component": "my-motor",
"command": "set_power"
}
}
}
}

Available dial properties:

  • component - Component to call when dial is turned
  • command - Command to execute on the component

Dial example

{
"dials": [
{
"dial": 0,
"component": "foo",
"command": "SetPosition"
}
]
}

Combining Updates

You can update multiple aspects in a single DoCommand:

{
"update_display": {
"brightness": 80,
"keys": {
"0": {
"text": "Active",
"color": "green"
},
"2": {
"text": "Inactive",
"color": "gray"
}
},
"dials": {
"0": {
"component": "volume-control",
"command": "set_level"
}
}
}
}

Response

The DoCommand returns a map indicating what was updated:

{
"brightness": 80,
"keys": [0, 2],
"dials": [0]
}

Self-Referencing Keys

Keys can reference the Stream Deck component itself by using the component's own name. This allows keys to trigger DoCommands that update the display dynamically:

{
"keys": [
{
"key": 0,
"text": "Toggle",
"component": "my-streamdeck",
"method": "do_command",
"args": [
{
"update_display": {
"keys": {
"1": {
"text": "Updated!",
"color": "yellow"
}
}
}
}
]
}
]
}

Pages

Instead of a flat list of keys, you can organize keys into named pages and switch between them at runtime using set_page. Use initial_page to set which page is displayed on startup. Keys can navigate between pages by referencing the Stream Deck component itself and calling set_page.

{
"brightness": 100,
"initial_page": "main",
"pages": {
"main": [
{
"key": 0,
"text": "Go to other",
"color": "blue",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "other" }]
},
{
"key": 1,
"text": "Hello",
"component": "foo",
"method": "do_command",
"args": [{ "x": 1 }]
}
],
"other": [
{
"key": 0,
"text": "Back",
"color": "red",
"component": "my-streamdeck",
"method": "do_command",
"args": [{ "set_page": "main" }]
},
{
"key": 1,
"text": "Do thing",
"component": "bar",
"method": "do_command",
"args": [{ "y": 2 }]
}
]
}
}

You cannot use keys and pages at the same time.

Response-driven page switching

When a key (do_command) or dial (DoCommand) sends a command to another component, the Stream Deck waits for the response and inspects it for a "mode" field. If present and a non-empty string, the deck switches to the page of that name — exactly as if set_page had been called on itself.

This lets a separate module own the navigation logic: the deck sends it a command, the module decides what should be shown next, and replies with the page to display.

{
"brightness": 100,
"initial_page": "menu",
"pages": {
"menu": [
{
"key": 0,
"text": "Play",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "start_game" }]
}
],
"board": [
{
"key": 0,
"text": "Resign",
"component": "chess-logic",
"method": "do_command",
"args": [{ "action": "resign" }]
}
]
}
}

In the example above, pressing Play sends {"action": "start_game"} to the chess-logic component. If chess-logic replies with {"mode": "board"}, the deck automatically switches to the board page.

Behavior notes:

  • The check is automatic for every do_command key and dial — no extra config flag.
  • If the response has no "mode" field (or it is not a non-empty string), nothing changes.
  • If "mode" names a page that does not exist, or the config uses flat keys instead of pages, a warning is logged and the button press is still considered successful.

pickup

This is a simple streamdeck app for picking things up

{
"brightness" : 100, // optional, 0 -> 100"arm" : "...",
"gripper" : "...",
"finder" : "...", // vision service that supports GetObjectPointClouds"motion" : "...", // motion service, could be 'builtin'"watch_pose" : "...", // an arm-saver position from where to watch
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages