8000 GitHub - amoinier/yeelight: Golang API for Yeelight · GitHub
[go: up one dir, main page]

Skip to content
amoinierPublic
forked from avarabyeu/yeelight

About

Golang API for Yeelight

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

8 Commits

Folders and files

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

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0