Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultClient provides an HTTP client implementation that uses the // InsecureSkipVerify flag to bypass errors caused by the bridge's // certificate - it does not contain a SAN for its IP address. DefaultClient = &http.Client{ Transport: &http.Transport{ TLSClientConfig: &tls.Config{ InsecureSkipVerify: true, }, }, } )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Host represents the host address of the bridge. Host string // Username represents the application key used for authentication. Username string // Client represents the http.Client used for the connections. If this // value is nil, DefaultClient is used. Note that the client must be // willing to accept the bridge's certificate, which is not signed by a CA // recognized in most operating systems. Client *http.Client }
Client represents a connection to a Hue bridge. Hostname must be set to the address of the bridge and Username needs to be set to the application key to use authenticated methods. Use the Register() method to obtain an application key.
func (*Client) Register ¶
Register attempts to register with the bridge and obtain an application key. This will likely fail the first time with an error instructing the user to push the physical button on their bridge - an identical call to this method a second time should then succeed. Upon success, the application key will be stored in the Username field of the Client.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher receives events from the bridge and maintains a list of resources and their current states.
func NewWatcher ¶
NewWatcher creates and initializes a new watcher using the provided client.