Hierarchy

  • EventEmitter
    • Device

Constructors

Properties

id: string
model: string
name: string
supported: boolean
versions: {
    ble: {
        hard: string;
        soft: string;
    };
    wifi: {
        hard: string;
        soft: string;
    };
}

Type declaration

  • ble: {
        hard: string;
        soft: string;
    }
    • hard: string
    • soft: string
  • wifi: {
        hard: string;
        soft: string;
    }
    • hard: string
    • soft: string

Accessors

  • get color(): {
        b: number;
        g: number;
        r: number;
    }
  • Returns {
        b: number;
        g: number;
        r: number;
    }

    • b: number
    • g: number
    • r: number

Methods

  • Switch auto update of the state on/off

    Parameters

    • on: boolean = true

      Whether to turn on or off the auto update

    Returns void

  • Destroy the device. This will stop the update interval and remove all listeners

    Returns void

  • Returns (string | symbol)[]

  • Fade the device to a color

    Returns

    Promise that resolves when the fade is complete

    Throws

    Error if the input color is invalid

    Throws

    Error if the from color is invalid

    Parameters

    • inputColor: ColorInput

      Colord | color input

    • steps: number

      Number of steps to fade (min 3, max 100000000)

    • duration: number

      Duration of fade in milliseconds (min 100, max 100000000)

    • fromColor: null | ColorInput = null

      Colord | color input (optional)

    Returns Promise<void>

  • Returns number

  • Get the current state of the device. This is not guaranteed to be up to date. Use waitForFirstUpdate to make sure the state is up to date before using this. It also includes some extra information about the last update and last state change.

    Returns

    The current state of the device

    Returns DeviceState & DeviceStateInfo

  • Type Parameters

    Parameters

    • event: E

    Returns number

  • Set the brightness of the device

    Parameters

    • brightness: number

      0-100

    Returns Promise<void>

  • Set the color of the device, using Colord

    Parameters

    • input: ColorInput

      Colord | color input

    • brightness: null | number = null

      0-100 (optional)

    Returns Promise<void>

  • Set the color temperature of the device

    Parameters

    • colorTemp: number

      2000-9000

    • safe: boolean = true

      If true, the color temperature will be clamped to the range 2000-9000 (default true)

    Returns Promise<void>

  • Set the color of the device

    Parameters

    • color: {
          b: number;
          g: number;
          r: number;
      }

      { r: 0-255, g: 0-255, b: 0-255 }

      • b: number
      • g: number
      • r: number

    Returns Promise<void>

  • Parameters

    • maxListeners: number

    Returns Device

  • Wait for an update to be received to make sure the device state is in sync with the device

    Returns

    Promise that resolves when an update is received

    Returns Promise<void>

  • Trigger the Govee API to update the device state

    Returns void

  • Turn off the device

    Returns Promise<void>

  • Turn on the device

    Returns Promise<void>

  • This is called when the device sends an update. Should not be called by the user. It checks if the ip has changed and emits an event if it has

    Parameters

    Returns void

  • Wait for the first state update to be received to make sure the device state is in sync with the device

    Returns

    Promise that resolves when the first state update is received

    Returns Promise<void>

Generated using TypeDoc