@ginden/blinkstick-v2
Version:
Improved Blickstick API for Node.js
30 lines • 796 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Led = void 0;
/**
* Class to control a single LED on a Blinkstick device.
* @category Implementation details
*/
class Led {
constructor(blinkstick, index) {
this.blinkstick = blinkstick;
this.index = index;
}
setColor(red, green, blue) {
return this.blinkstick.setColor(red, green, blue, { index: this.index });
}
/**
* Returns RGB tuple representing the current color of the LED.
*/
getColor() {
return this.blinkstick.getColor(this.index);
}
/**
* Turns of the LED by setting its color to black (0, 0, 0).
*/
turnOff() {
return this.setColor(0, 0, 0);
}
}
exports.Led = Led;
//# sourceMappingURL=led.js.map