Device
The device instance is made when a scan is performed, and new devices are found.
Main properties
Property | Type | Description |
---|---|---|
ip | string | The IP of the device. |
deviceID | string | The ID of the device. |
model | string | The model number of the device. |
socket | See Govee | Reference to socket that found the device. Used internally. |
versions | See versions | Object that contains the hardware and software version numbers. |
state | See state | The current light state. |
actions | See actions | Object that contains the functions you can use to control the light |
updateValues | Function | Function to update the state of the light |
Versions
Property | Description |
---|---|
BLEhardware | The Bluetooth hardware version number |
BLEsoftware | The Bluetooth software version number |
WiFiHardware | The WiFi hardware version number |
WiFiSoftware | The WiFi software version number |
State
Property | Type | Description |
---|---|---|
isOn | number (0-1) | 1 when light is on, 0 when light is off. |
brightness | number (0-100) | 0-100 representing light brightness. |
color | { r: number, g: number, b: number } | RGB object representing the color. |
colorKelvin | number | Kelvin. Govee says it ranges from 2000-9000, but you can set it higher and lower without issues |
Actions
All actions return a promise, so you can await the acknowledgement.
Name | Parameters | Description |
---|---|---|
setColor | see color options | Set the color of the light. |
setBrightness | brightness: number | Set the brightness of the light. |
fadeColor | see fade options | Fade the color or brightness of the light. |
setOff | No parameters | Turn off the light. |
setOn | No parameters | Turn on the light. |
Fade options
Property | Type | Description |
---|---|---|
time | number | The duration (in milliseconds) of the fade. |
color (optional) | see color options | Target color. |
brightness (optional) | number (0-100) | brightness |
Color options
Property | Type | Description |
---|---|---|
HEX | string | Hex value. Can include a # |
RGB | [number, number, number] | Array of 3 numbers (0-255), representing r, g and b |
HSL | [number, number, number] | Array of 3 numbers (0-255), representing r, g and b |
Kelvin | number | Kelvin. Govee says it ranges from 2000-9000, but you can set it higher and lower without issues |
You only have to define 1 color
If you do define more, only the first one of this list is used:
- HSL
- RGB
- HEX
- Kelvin