bitfocus / companion-module-generic-artnet

MIT License
0 stars 2 forks source link

Increase / Decrease #2

Closed killianbc closed 2 years ago

killianbc commented 4 years ago

it would be convenient to have these two additional actions:

killianbc commented 4 years ago

sorry, my programming knowledge is limited. I think we should add something like this

case 'increase':
            if (self.client !== undefined) {
                self.data[action.options.channel-1] = self.data[action.options.channel-1] + action.options.value;
                if (self.data[action.options.channel-1] > 255) {
                    self.data[action.options.channel-1] = 255;
                }
                self.client.send(self.data);
            }
            break;
case 'decrease':
            if (self.client !== undefined) {
                self.data[action.options.channel-1] = self.data[action.options.channel-1] - action.options.value;
                if (self.data[action.options.channel-1] < 0) {
                    self.data[action.options.channel-1] = 0;
                }
                self.client.send(self.data);
            }
            break;

At this place: https://github.com/bitfocus/companion-module-generic-artnet/blob/f57a06abbd0abefd9fc731b6850ca8ebc06a024d/artnet.js#L173