timothycrosley / streamdeck-ui

A Linux compatible UI for the Elgato Stream Deck.
https://timothycrosley.github.io/streamdeck-ui/
MIT License
1.14k stars 241 forks source link

Create action that stores key/value pair #203

Open liljenstolpe opened 2 years ago

liljenstolpe commented 2 years ago

Here's the use case

A page to control a couple of key lights. 5 buttons for different temperatures, 5 buttons for brightness level, 2 buttons for on/off.

What I would like to do is use 2 buttons to toggle if the other button presses are affecting a given light. Think of it this way two buttons labeled "key 0" and "key 1" Press one or two of them and the state changes (say highlighted for selected) and that also sets an environment variable or python variable for which "lights" should be modified. Then the off, on, temp, or brightness keys are uses to send the keylight cli command to the correct light(s).

Possible?

dodgyrabbit commented 2 years ago

If I understand the request correctly: you want to make a device selection with a set of keys (i.e. decide which light to control) and then use a pair of adjustment buttons (up/down) to control the selected light?

You can currently work around this by:

  1. Making each device selection go to a different page.
  2. Have your control keys on the new page (up/down) in the same spot. Create the control keys so that they specifically control the device on that page
  3. You can still have all the other devices on each page. Pressing them, navigate them to the "their" page

Would be a bit of work to set it all up but certainly doable.

dodgyrabbit commented 2 years ago

Capturing some thoughts on this feature for posterity sake:

Create a new action called Set variable. For example, a name/value pair. light=upstairs. Allow other actions to access variables, perhaps with a template system.

For example:

Create a command action as follows: toggle-smart-switch {light}.

In this case, the token {light} will be replaced with upstairs.

This will allow you to create a series of buttons that changes the variable light to different values. One button can then execute an action using the variable.

There are some things to consider:

sftim commented 2 years ago

It'd be great to have a mechanism to have external events also update state. For example, if I have a play / pause button, I'd like the button to show a “play” icon if my system (say MPRIS) thinks the state is paused, and a pause icon if the system thinks the state is playing.

In fact, how about building that external mechanism first and providing some example hooks / scripts to show how you can use that to both control a light and reflect the change in the button.

This mehanism might also resolve https://github.com/timothycrosley/streamdeck-ui/issues/72 (clock / time display).

coolapso commented 1 year ago

hi, this project seems to be stale and a new fork as been made with the intention of replacing this one.

if this still an issue please reopen it at: https://github.com/streamdeck-linux-gui/streamdeck-linux-gui