node-dmx / dmx

DMX controller library for node.js
MIT License
297 stars 96 forks source link

Add preset animations #57

Closed pboyd04 closed 6 years ago

pboyd04 commented 6 years ago

Add ability to provide preset animations to the web service

bluemaex commented 6 years ago

@pboyd04 Very cool - Do you have an example animation for the configuration so I can test this? (And it to the documentation)

pboyd04 commented 6 years ago

@bluemaex My config is obviously different. Here is what I have in my config file:

"animPresets": [
        {
            "label": "RGB",
            "anim": {
                "office": [
                    {"to": {"2": 0, "3": 0, "4": 0}},
                    {"to": {"2": 255}, "duration": 1000},
                    {"to": {"3": 255}, "duration": 1000},
                    {"to": {"4": 255}, "duration": 1000}
                ]
            }
        }
    ]

You should be able to take your example post and just add it. Something like:

"animPresets": [{
        "label": "test",
        "anim": {
            "office": [{
                    "to": {
                        "10": 0,
                        "20": 0
                    }
                },
                {
                    "to": {
                        "10": 255
                    },
                    "duration": 2000
                },
                {
                    "to": {
                        "20": 255
                    },
                    "duration": 1000
                }
            ]
        }
    }]
bluemaex commented 6 years ago

Nice, thank you, gonna have a look at it 👍

bluemaex commented 6 years ago

❤️