UNPKG

homebridge-dmxlight-plugin

Version:
30 lines 1.47 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SacnUniverse = void 0; const e131_1 = require("e131"); class SacnUniverse { constructor(ipAddress, universe, channelStart, channelCount, colorOrder, transitionEffect, transitionEffectDuration, log) { // Configure Streaming ACN if (ipAddress !== '') { this.sacnClient = new e131_1.Client(ipAddress); } else { this.sacnClient = new e131_1.Client('localhost'); } // Create packets. The buffer size should match the number of pixels needed (8 * 3 = 24) so use the channel count. // If the pixel is white only, then the buffer size should equal 1 for each light. this.sacnPacket = this.sacnClient.createPacket(channelCount); this.sacnPacket.setSourceName('DMXLightPlugin'); this.sacnPacket.setUniverse(universe); this.sacnSlotsData = this.sacnPacket.getSlotsData(); this.universe = universe; this.channelStart = channelStart; this.channelCount = channelCount; this.colorOrder = colorOrder.toLocaleLowerCase(); this.transitionEffect = transitionEffect.toLocaleLowerCase(); this.transitionEffectDuration = transitionEffectDuration; log.info('Initialized new SACN Universe #' + universe + ' with ' + channelCount + ' channel(s)'); } } exports.SacnUniverse = SacnUniverse; //# sourceMappingURL=sacnUniverse.js.map