Skip to content

Commit 25b2a4a

Browse files
authored
Synced with main branch
1 parent 4e54372 commit 25b2a4a

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

godice.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -304,19 +304,17 @@ class GoDice {
304304
}
305305

306306
/**
307-
* Pulses LEDs for set time and color
308-
* @param {number} pulseCOunt - an integer of how many times the pulse will repeat (max 255)
309-
* @param {number} onTime - how much time should the LED be on each pulse (units of 10ms, max 255)
310-
* @param {number} offTOme - how much time should the LED be off each pulse (units of 10ms, max 255)
311-
* @param {Array} RGB - an array to control both LEDs color's in the following format '[R, G, B]'
312-
* where R, G and B are number in the range of 0-255
313-
*/
307+
* Pulses LEDs for set time and color
308+
* @param {number} pulseCount - an integer of how many times the pulse will repeat (max 255)
309+
* @param {number} onTime - how much time should the LED be ON each pulse (units of 10ms, max 255)
310+
* @param {number} offTime - how much time should the LED be OFF each pulse (units of 10ms, max 255)
311+
* @param {Array} RGB - an array to control both LEDs color's in the following format '[R, G, B]'
312+
* where R, G and B are number in the range of 0-255
313+
*/
314314
pulseLed(pulseCount, onTime, offTime, RGB) {
315-
// first boolean - isMix
316-
// second boolean - onlyOneLED
317315
if (RGB.length === 3) {
318-
let adjRGB = RGB.map((i) => Math.max(Math.min(i, 255), 0));
319-
const messageArray = [this.messageIdentifiers.SET_LED_TOGGLE, pulseCount, onTime, offTime, ...adjRGB, 1, 0]
316+
let rgbColor = RGB.map((i) => Math.max(Math.min(i, 255), 0));
317+
const messageArray = [this.messageIdentifiers.SET_LED_TOGGLE, pulseCount, onTime, offTime, ...rgbColor, 1, 0]
320318
this.sendMessage(messageArray);
321319
}
322320
}
@@ -530,7 +528,6 @@ class GoDice {
530528
.then(_ => {
531529
console.debug('onDiceConnected');
532530
this.onDiceConnected(this.GlobalDeviceId, this);
533-
console.log(this)
534531
})
535532
.catch(error => {
536533
console.error('Argh! ' + error);

0 commit comments

Comments
 (0)