tritium_remote

A library for interacting with Tritium systems.

Implemented in Rust but with bindings to

NB It is assumed that the Tritium system is being accessed over a LAN without encryption. The Gateway node must be launched with the --insecure-websockets option, like so:

ExecStart = /opt/tritium/bin/gateway_node --insecure-websockets

Hosted docs are here (require login).

APIs

Sequence playback

Scripting

Running Examples

The Rust and Python examples use the TRITIUMAUTHTOKEN environment variable to get the JWT access token they need.

Pending a proper UI for generating tokens, the best way for now is...

  1. Log into the Tritium cloud UI
  2. Connect to your locally-running system
  3. Go to the "Scripts" page
  4. Select the API Keys tab
  5. Click "CREATE AN API KEY"

bash $ export TRITIUM_AUTH_TOKEN={paste x-tritium-auth contents here} $ cd tritium-remote/examples/system_info $ cargo run

Generated GraphQL Code

Rust structures are generated from the GraphQL schemas using graphql-client

Install graphql-client with:

bash $ cargo install graphql_client_cli

Then to generate Rust code for the playSequence mutation as an example, in the repository root:

bash $ cd tritium-remote $ graphql-client generate --schema-path graphql/schemas/tritium.graphql --output-directory src/graphql/mutations graphql/mutations/play_sequence.graphql

License

This project is licensed under either of

at your option.