An extensive Philips Hue client library for Go with an emphasis on simplicity
Clone or download
amimof Merge pull request #3 from amimof/release_1.0.2
Updated README for 1.0.2 release
Latest commit 613c1fc Nov 28, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
logo Updated logo and README Apr 4, 2018
.gitignore Refactored Response struct Jan 1, 2018
CHANGELOG.md Fixed typo and updated README Nov 27, 2018
LICENSE Initial commit May 16, 2017
README.md Updated README for 1.0.2 release Nov 28, 2018
bridge.go Updated README Nov 27, 2018
bridge_test.go Updated README Nov 27, 2018
capabilities.go Implement httpmock for tests Nov 27, 2018
capabilities_test.go Init username and password as global vars in huego_test.go Nov 22, 2018
config.go Init username and password as global vars in huego_test.go Nov 22, 2018
config_test.go Implement httpmock for tests Nov 27, 2018
go.mod Init username and password as global vars in huego_test.go Nov 22, 2018
group.go Implement httpmock for tests Nov 27, 2018
group_test.go Implement httpmock for tests Nov 27, 2018
huego.go Implement httpmock for tests Nov 27, 2018
huego_test.go Fixed typo and updated README Nov 27, 2018
light.go Implemented Capabilities logic Feb 2, 2018
light_test.go Implement httpmock for tests Nov 27, 2018
resourcelink.go Added logo. govet golint gofmt Jan 21, 2018
resourcelink_test.go Implement httpmock for tests Nov 27, 2018
rule.go Updated logo and README Apr 4, 2018
rule_test.go Implement httpmock for tests Nov 27, 2018
scene.go GetScene now alos returns LightStates map Feb 3, 2018
scene_test.go Implement httpmock for tests Nov 27, 2018
schedule.go Added logo. govet golint gofmt Jan 21, 2018
schedule_test.go Implement httpmock for tests Nov 27, 2018
sensor.go Fix sensor types Aug 19, 2018
sensor_test.go Implement httpmock for tests Nov 27, 2018

README.md

huego Go Report Card Coverage Awesome

Huego

An extensive Philips Hue client library for Go with an emphasis on simplicity. It is designed to be clean, unbloated and extensible. With Huego you can interact with any Philips Hue bridge and its resources including Lights, Groups, Scenes, Sensors, Rules, Schedules, Resourcelinks, Capabilities and Configuration .

Installation

Get the package and import it in your code.

go get github.com/amimof/huego

You may use New() if you have already created an user and know the IP address to your bridge.

package main

import (
  "github.com/amimof/huego"
  "fmt"
)

func main() {
  bridge := huego.New("192.168.1.59", "username")
  l, err := bridge.GetLights()
  if err != nil {
    panic(err)
  }
  fmt.Printf("Found %d lights", len(l))
}

Or discover a bridge on your network with Discover() and create a new user with CreateUser().

func main() {
  bridge, _ := huego.Discover()
  user, _ := bridge.CreateUser("my awesome hue app") // Link button needs to be pressed
  bridge = bridge.Login(user)
  light, _ := bridge.GetLight(3)
  light.Off()
}

Documentation

See godoc.org/github.com/amimof/huego for the full package documentation.

Contributing

All help in any form is highly appreciated and your are welcome participate in developing Huego together. To contribute submit a Pull Request. If you want to provide feedback, open up a Github Issue or contact me personally.