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

Simulator#Lighting should provide more data to have a more fine grained control over the scenes in luminave #2572

Closed
TimPietrusky opened this issue Oct 11, 2019 · 3 comments
Labels
type/feature an issue describing new functionality

Comments

@TimPietrusky
Copy link

TimPietrusky commented Oct 11, 2019

In order to have more control of the lighting inside the simulator, it would be nice to get more information out of Thorium in the Simulator#Lighting API endpoint instead of just the current color that already was translated by Thorium based on something else that happened (for example an Alert level change).

Use Cases

  • Status of the flight (started, ended, paused, running) so when the flight is done we do not switch off all lights, see Lighting Blackout #2570
  • What is the current alert level

Solution

Extend the GraphQL API on Simulator#Lighting

Alternatives

Mapping the corresponding alert level colors to scenes in luminave, but that is very confusing in the future and might also break if a browser would send something else for a certain color.

Additional context

In NERDDISCO/luminave-thorium#9 I created an issue for the alternative "alert levels", but I would love to actually use the enhanced data from Thorium to make this as flexible as possible.

Also when this gets implemented, it will be a lot easier to support the use case "Alerts" in NERDDISCO/luminave#110

@TimPietrusky TimPietrusky added the type/feature an issue describing new functionality label Oct 11, 2019
@TimPietrusky
Copy link
Author

@alexanderson1993 do you have any other use cases where data from Thorium could be used to control lights that I forgot?

@alexanderson1993
Copy link
Member

As it turns out, alert level and flight status can be accessed via GraphQL already. alertlevel is available in the Simulator query:

query Lighting($id: ID!) {
  simulators(id: $id) {
    id
    alertlevel
	lighting {
	  intensity
	  action
	  actionStrength
	  transitionDuration
	  useAlertColor
	  color
	}
  }
}

And you can get the flight running status from the client query:

query Client($clientId: ID!) {
    clients(clientId: $clientId) {
		flight {
		  id
		  name
		  running
		}
    }
  }

If flight returns a null value, then the client hasn't been assigned to a flight, which means no flight is currently running.

Pretty much all data in Thorium can be accessed via the GraphQL API.

@TimPietrusky
Copy link
Author

@alexanderson1993 thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature an issue describing new functionality
Projects
None yet
Development

No branches or pull requests

2 participants