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
- Host: GitHub
- URL: https://github.com/finnkauski/lightshow
- Owner: finnkauski
- Created: 2020-06-06T18:04:22.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-14T15:21:30.000Z (almost 6 years ago)
- Last Synced: 2024-12-31T02:26:22.275Z (over 1 year ago)
- Topics: experimental, hue, language, lights, philips, philips-hue, scripting, scripting-language
- Language: Rust
- Size: 27.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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;
```