Skip to content

avarabyeu/yeelight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status License MIT Go Report Card Code Coverage

yeelight

Golang API for Yeelight

Overview

Yeelight is simple command line tool and Golang implementation API of Yeelight protocol with notification listening support

Installation

Make sure you have a working Go environment. See Golang install instructionshttp://golang.org/doc/install.html)

To install, run:

go get github.com/avarabyeu/yeelight

Usage

func main() {
	y, err := yeelight.Discover()
	checkError(err)

	on, err := y.GetProp("power")
	checkError(err)
	fmt.Printf("Power is %s", on[0].(string))

	notifications, done, err := y.Listen()
	checkError(err)
	go func() {
		<-time.After(time.Second)
		done <- struct{}{}
	}()
	for n := range notifications {
		fmt.Println(n)
	}

	context.Background().Done()

}

API Specification

Yeelight API Specification [can be found here] (https://www.yeelight.com/download/Yeelight_Inter-Operation_Spec.pdf)

License

yeelight is distributed under the MIT license

Legal

Yeelight® is a registered trademark of Yeelight.

About

Golang API for Yeelight

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published