Setting color
- CommonJS
- ESM
const Govee = require("govee-lan-control");
var govee = new Govee.default();
govee.on("deviceAdded", async (device) =>
{
console.log("New Device!", device.model);
// Set random color
while (true)
{
// This will try and go as fast as possible, so we await the acknowledgement to send the next one.
await device.actions.setColor({
// Other options for setting color are supported, like, HSL, HEX and kelvin
rgb: [
Math.random() * 255,
Math.random() * 255,
Math.random() * 255,
],
});
}
});
import Govee from "govee-lan-control";
var govee = new Govee();
govee.on("deviceAdded", async (device) =>
{
console.log("New Device!", device.model);
// Set random color
while (true)
{
// This will try and go as fast as possible, so we await the acknowledgement to send the next one.
await device.actions.setColor({
// Other options for setting color are supported, like, HSL, HEX and kelvin
rgb: [
Math.random() * 255,
Math.random() * 255,
Math.random() * 255,
],
});
}
});