An open API service indexing awesome lists of open source software.

https://github.com/finnkauski/lightshow

Simple scripting language to write light shows for Hue lights
https://github.com/finnkauski/lightshow

experimental hue language lights philips philips-hue scripting scripting-language

Last synced: 3 months ago
JSON representation

Simple scripting language to write light shows for Hue lights

Awesome Lists containing this project

README

          

# Lightshow 🚥

Make use of your Hue lights and set up a lightshow!

## About

This project stems from me learning Rust and trying to find a practical application
that would guide my learning.

A while back I created a Rust wrapper for the Hue lights called [lighthouse](https://github.com/finnkauski/lighthouse).
I then got sidetracked into writing other tools and fun stuff based on that API:

- trigger lights from by playing my drums: [see here](https://www.youtube.com/watch?v=fEK2DofSwEE).
- change light color in your room based on what type of code you write: [see here](https://github.com/finnkauski/lighthouse.el)

As part of that I decided that I wanted to somehow store mappings of light behaviour to the midi input sequences.
I wrote a really poor parser for a format and just left it. But having learned Haskell previously I always wanted
to try parser combinators.

This project is essentially me learning parser combinators by writing a scripting language that my
lights can interpret and that I can later map to my drums.

## Usage

1. `cargo install --git https://github.com/finnkauski/lightshow`
2. `lshow ../path/to/file.lshow`

The following are example syntax for the language.

### Syntax

Generally - check out `example.lshow` for a sample script.

- change color to the given hex color - `color `
- blink lights - `blink `
- wait for n seconds `wait `

You can assign an action to a variable as follows:

```
variable_action: act = color ff0000;
```

This defines a sequence of individual `actions` or commands to your lights.

```
variable_sequence: seq = {
color ff0000;
wait 1;
color 00ff00;
wait 1;
color 0000ff;
};
```

And finally the way to trigger the saved actions or sequences is by using the `trigger` statement.

```
trigger variable_sequence;
```