- Notifications
You must be signed in to change notification settings - Fork36
An extensive Philips Hue client library for Go with an emphasis on simplicity
License
amimof/huego
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
An extensive Philips Hue client library forGo
with an emphasis on simplicity. It is designed to be clean, unbloated and extensible. WithHuego
you can interact with any Philips Hue bridge and its resources includingLights
,Groups
,Scenes
,Sensors
,Rules
,Schedules
,Resourcelinks
,Capabilities
andConfiguration
.
Get the package and import it in your code.
go get github.com/amimof/huego
You may useNew()
if you have already created an user and know the IP address to your bridge.
package mainimport ("github.com/amimof/huego""fmt")funcmain() {bridge:=huego.New("192.168.1.59","username")l,err:=bridge.GetLights()iferr!=nil {panic(err) }fmt.Printf("Found %d lights",len(l))}
Or discover a bridge on your network withDiscover()
and create a new user withCreateUser()
. To successfully create a user, the link button on your bridge must have been pressed before callingCreateUser()
in order to authorise the request.
funcmain() {bridge,_:=huego.Discover()user,_:=bridge.CreateUser("my awesome hue app")// Link button needs to be pressedbridge=bridge.Login(user)light,_:=bridge.GetLight(3)light.Off()}
Seegodoc.org/github.com/amimof/huego for the full package documentation.
All help in any form is highly appreciated and your are welcome participate in developingHuego
together. To contribute submit aPull Request
. If you want to provide feedback, open up a GithubIssue
or contact me personally.
About
An extensive Philips Hue client library for Go with an emphasis on simplicity