Skip to content
This repository has been archived by the owner on Jun 27, 2021. It is now read-only.
/ yeelight Public archive
forked from avarabyeu/yeelight

Easy interaction with Yeelights in Go

License

Notifications You must be signed in to change notification settings

newbits/yeelight

 
 

Repository files navigation

yeelight

This is a library to communicate with the Yeelights in your network. It allows you to easily change the color, brightness, power, etc.

Installation

To install, run:

go get github.com/newbits/yeelight

Usage

func main() {
  // Discover and retrieve a single Yeelight in the network
  y, err := yeelight.Discover()
  if err != nil {
    log.Fatal(err)
  }

  // Toggle power
  y.Power()

  // Set color
  y.Color("#112233")

  // Set brightness (percentage)
  y.Brightness(85)

  // Retrieve single property
  prop, _ := y.Prop("power")
  fmt.Printf("Power is %s", prop[0].(string))
}

API Specification

The Yeelight API Specification can be found here

Legal

Yeelight is a registered trademark of Yeelight.