Skip to main content

Fading color and brightness

const Govee = require("govee-lan-control");

var govee = new Govee.default();

govee.on("deviceAdded", (device) =>
{
console.log("New Device!", device.model);

// Fade every 2 seconds to a new brightness and color.
setInterval(() =>
{
device.actions.fadeColor({
time: 2000,
color: {
hex: Math.floor(Math.random() * 16777215).toString(16)
},
brightness: Math.random() * 100
});
}, 2000);
});