Fading color and brightness
- CommonJS
- ESM
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);
});
import Govee from "govee-lan-control";
var govee = new Govee();
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);
});