The Govee instance
Create the instance
- CommonJS
- ESM
const Govee = require("govee-lan-control");
var govee = new Govee.default();
import Govee from "govee-lan-control";
var govee = new Govee();
Only 1 instance allowed
Don't make more than 1 instance. I use global data.
Yes I know it's bad. If it bothers you, please help fix it on the Github
Yes I know it's bad. If it bothers you, please help fix it on the Github
Discover devices
This gets run at the creation of the Govee instance.
govee.discover();
event
When a new device is found, it emits the deviceAdded event.
Update all device states
govee.updateAllDevices();
event
When a device has changed its state, it emits the updatedStatus event.
Get retrieved devices
There are 2 ways of retrieving the devices: In a map, or in an array.
// Get the devices in array form
govee.devicesArray
// Get the devices in map form (the ip is the key)
govee.devicesMap