Device instance events
Status has changed
Parameter | Type | Description |
---|---|---|
data | Record<string, any> | Raw JSON data retrieved from the device |
stateChanged | Govee.stateChangedOptions | Array with the things that changed, can include "onOff", "brightness" and "color" |
- Javascript
- Typescript
device.on("updatedStatus", (data, stateChanged) =>
{
console.log(device.model + " state updated.", stateChanged + " got changed")
})
// Extra imports are needed
import Govee, {DataResponseSatus, stateChangedOptions} from "govee-lan-control";
device.on("updatedStatus", (data: DataResponseStatus, stateChanged: stateChangedOptions) =>
{
console.log(device.model + " state updated.", stateChanged + " got changed")
})
Device destroyed
device.on("destroyed", () =>
{
console.log(device.model + " state updated.", stateChanged + " got changed")
})