api

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2017 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PutLamp

func PutLamp(config Config, lamp *Lamp) (err error)

PutLamp update the State of a Hue Lamp using the API id refers to the Lamp ID from the API address refers to the bridge IP Address, the API Address username refers to a hash key/token generated from the API when registered a device/user

Types

type Config

type Config struct {
	Id       int
	Address  string
	Username string
}

Config contain the necessary data to interact with the API

func GetConfig

func GetConfig() (config Config, err error)

GetConfig read the config.yml file in the executable directory and return it

type Lamp

type Lamp struct {
	State LampState `json:"state"`
}

Lamp hold informations of a Hue Lamp from the API

func GetLamp

func GetLamp(config Config) (lamp *Lamp, err error)

GetLamp request to the API for informations about a Hue Lamp id refers to the Lamp ID from the API address refers to the bridge IP Address, the API Address username refers to a hash key/token generated from the API when registered a device/user It returns a Lamp with the current State

type LampState

type LampState struct {
	On         bool `json:"on"`
	Brightness int  `json:"bri"`
	Reachable  bool `json:"reachable"`
}

LampState represents the State of a Hue Lamp from the API

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL