Skip to content

Commit

Permalink
fix(controller): Error message for updateUniverse
Browse files Browse the repository at this point in the history
Changed the error message for "updateUniverse" to the correct type "number".
  • Loading branch information
TimPietrusky committed May 14, 2018
1 parent 5261594 commit ebdd3d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,16 @@ export default class Controller {
// The DMX512 universe starts with channel 1, but the array with 0
channel = channel - 1

// Single
if (Number.isInteger(value)) {
this.universe.splice(channel, 1, value)

// Multiple
} else if (Array.isArray(value)) {
this.universe.splice(channel, value.length, ...value)

} else {
return reject(new Error('Could not update Universe because the provided value is not of type Integer or Array'))
return reject(new Error('Could not update Universe because the provided value is not of type number or number[]'))
}

// Send the updated universe to the DMX512 controller
Expand Down

0 comments on commit ebdd3d9

Please sign in to comment.