Go to file
2020-05-14 22:16:54 +02:00
monitor cleanup 2019-02-12 01:26:41 +01:00
utils update comments 2019-02-12 01:26:50 +01:00
.gitignore Initial commit 2019-02-08 19:18:07 +01:00
bridge.go fix: nil pointer issues 2020-05-14 22:16:54 +02:00
config.go made package exportable 2019-02-10 20:43:22 +01:00
config.yaml bla 2019-02-09 16:56:58 +01:00
go.mod fix: nil pointer issues 2020-05-14 22:16:54 +02:00
go.sum fix: nil pointer issues 2020-05-14 22:16:54 +02:00
groups_test.go added end to end encoding test with a hue 2019-02-15 23:36:08 +01:00
groups.go fix: nil pointer issues 2020-05-14 22:16:54 +02:00
INFO.md added todo and info 2019-02-09 16:13:31 +01:00
LICENSE Initial commit 2019-02-08 19:18:07 +01:00
lights_test.go add toggle light test 2019-02-14 11:58:16 +01:00
lights.go fix: nil pointer issues 2020-05-14 22:16:54 +02:00
README.md Update readme 2019-02-14 11:58:36 +01:00
scene.go added rudimentary support for scenes 2019-02-20 15:14:52 +01:00
state.go fix: nil pointer issues 2020-05-14 22:16:54 +02:00
time.go added lights test and time interface 2019-02-11 23:01:08 +01:00
TODO.md brought TODO a bit up to speed 2019-02-20 15:14:30 +01:00
user.go made package exportable 2019-02-10 20:43:22 +01:00

Go Report Card License: GPL v3

go-hue-interface

Connect to a hue bridge

In your code create a hue bridge instance

    func main() {
        // ...
        // create a bridge config
        bridgeConf := &Config{
            Username:         "YOUR_DEVICE_USERNAME", // check below for detailed instructions
            BridgeAddr:       "YOUR_BRIDGE_IP_ADDR", // check below where to find the ip address of the hue
            BridgeAddrScheme: "http",
	    }

        // create bridge
        bridge := NewBridge(config)

        // now do stuff with bridge
        // get ligts as a map of lights over ids
        lights, errLights := bridge.GetLights()
        if errLights {
            fmt.Println("Failed to get lights")
        }

        // Turn all lights on
        for id, _ := range lights {
            bridge.ToggleLight(id, true)
        }
    }