Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What should happen when using the Lighting controls? #1645

Closed
TimPietrusky opened this issue Dec 10, 2018 · 3 comments
Closed

What should happen when using the Lighting controls? #1645

TimPietrusky opened this issue Dec 10, 2018 · 3 comments

Comments

@TimPietrusky
Copy link

TimPietrusky commented Dec 10, 2018

Detailed Description

I'm working on integrating light control into Thorium. There are already controls available, but it's hard for me to understand what the desired outcome is when using these controls.

Is there a documentation? So that I know how the actual lights should be controlled?
What was the idea behind the current controls?

@alexanderson1993
Copy link
Member

This is the query that I use to get the lighting data out of Thorium:

  query Simulators($simulatorId: String) {
    simulators(id: $simulatorId) {
      id
      lighting {
        intensity # [0 - 1] How bright the lights should be
        action # One of 'normal', 'fade', 'shake', 'strobe', 'oscillate'
        actionStrength # [0 - 1] How intense the action is. How quickly it shakes, or how fast it strobes or oscillates
        transitionDuration # How long a 'fade' action should last in milliseconds
        color # A suggested color for the lights
      }
    }
  }

(There is a corresponding subscription called simulatorsUpdate)

Almost all of the logic for how these values are supposed to be interpreted is left up to the lighting controls software. Below I give some guidelines for my intention with these settings.

color is a suggestion for what color the lights should be. This doesn't mean all the lights need to be this color, but they can be.

The lighting control software should take the action and perform whatever function is necessary for the action. If the action is 'shake', it should apply random intensities to the lights so they shake (as in an explosion). However, if intensity is set to 0.5, it should multiply the random intensity by that value so it is a darker shake. actionStrength would make the shake more or less intense. So if actionStrength is 1, it would be a crazy-powerful shake. If it was at 0.1, it would be hardly a flicker.

"Strobe" should flash the lights on and off, with the actionStrength making the strobe faster or slower.

"Oscillate" should make the lights fade in and out continuously. actionStrength works the same way as it does with the "Shake" action.

"Fade" makes it so changing the intensity does a linear interpolation over the transitionDuration time.

One thing which Thorium does automatically - if the 'Shake Long' or 'Shake Short' buttons are pressed or if the "Fade Up" or "Fade Down" buttons are pressed, it will automatically switch the action back to 'normal' after the transitionDuration.

If there is anything in this API that should be updated, changed, improved, added to... whatever - just let me know. I'm happy to extend it to do whatever you need it to do.

@alexanderson1993
Copy link
Member

I believe this has been addressed. If you have any more questions, you can open a new issue or comment on this one. I'm going to close this one.

@TimPietrusky
Copy link
Author

TimPietrusky commented Dec 12, 2018

Thank you, this helps a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants