Git Product home page Git Product logo

huego's Introduction

Go Go Report Card codecov 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(). To successfully create a user, the link button on your bridge must have been pressed before calling CreateUser() in order to authorise the request.

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.

huego's People

Contributors

amimof avatar bboehmke avatar steelphase avatar duhruh avatar emdioh avatar felixls avatar dlsniper avatar martinrhoads avatar matzew avatar willie68 avatar kevinms avatar smonesi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.