Setting brightness
- 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 brightness
while (true)
{
var brightness = Math.random() * 100;
// This will try and go as fast as possible, so we await the acknowledgement to send the next one.
await device.actions.setBrightness(brightness);
// EPILEPSY WARNING
}
});
import Govee from "govee-lan-control";
var govee = new Govee();
govee.on("deviceAdded", async (device) =>
{
console.log("New Device!", device.model);
// Set random brightness
while (true)
{
var brightness = Math.random() * 100;
// This will try and go as fast as possible, so we await the acknowledgement to send the next one.
await device.actions.setBrightness(brightness);
// EPILEPSY WARNING
}
});