For documentation, check out the link to godoc above.
- Added configuration API
- Added scenes API
- Added additional bridge discovery method (LAN scanning)
- Added HTTPS support (needs bridge API version 1.24)
- Added rate limiting
- Adapt API changes
- Fixed documentation issues
- Fixed
go vet
andgo lint
issues
To start using the hue API, you first need to register your device.
package main
import "fmt"
import "github.com/stefanwichmann/go.hue"
func main() {
bridges, _ := hue.DiscoverBridges(false)
bridge := bridges[0] //Use the first bridge found
//Remember to push the button on your hue first
err := bridge.CreateUser("my nifty app")
if err != nil {
fmt.Printf("Device registration failed: %v\n", err)
}
fmt.Printf("Registered new device => %+v\n", bridge)
}
package main
import "github.com/stefanwichmann/go.hue"
func main() {
bridge := hue.NewBridge("your-ip-address", "your-device-name")
lights, _ := bridge.GetAllLights()
for _, light := range lights {
light.On()
}
}
package main
import "github.com/stefanwichmann/go.hue"
func main() {
bridge := hue.NewBridge("your-ip-address", "your-device-name")
lights, _ := bridge.GetAllLights()
for _, light := range lights {
light.ColorLoop()
}
}
package main
import "github.com/stefanwichmann/go.hue"
func main() {
bridge := hue.NewBridge("your-ip-address", "your-device-name")
light, _ := bridge.FindLightByName("Bathroom Light")
light.On()
}