Documentation ¶
Index ¶
- func DiscoverBridgeAddress() (address string, err error)
- func PutLamp(config Config, lamp *Lamp) (err error)
- func RegisterUser(config Config) (username string, err error)
- func SetConfig(config *Config) (err error)
- func UnregisterUser(config Config) (err error)
- type Config
- type Lamp
- type LampState
- type NUPnP
- type RegisterError
- type RegisterResponse
- type RegisterSuccess
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverBridgeAddress ¶ added in v0.7.0
DiscoverBridgeAddress use meethue.com/api/nupnp to find the Philips Hue Bridge locally
func RegisterUser ¶ added in v0.7.0
RegisterUser ask for Philips Hue Bridge to register a new username
func UnregisterUser ¶ added in v0.7.0
UnregisterUser delete the username on config from the Philips Hue Bridge
Types ¶
type Config ¶
type Config struct { Id int `yaml:"id"` Address string `yaml:"address"` Username string `yaml:"username"` Steps int `yaml:"steps"` }
Config contain the necessary data to interact with the API
type Lamp ¶
type Lamp struct {
State LampState `json:"state"`
}
Lamp hold informations of a Hue Lamp from the API
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
type NUPnP ¶ added in v0.7.0
type NUPnP struct {
Address string `json:"internalipaddress"`
}
NUPnP represents the response from the search of a Hue Bridge
type RegisterError ¶ added in v0.7.0
type RegisterError struct { ErrorType int `json:"type"` Address string `json:"address"` Description string `json:"description"` }
RegisterError represent the data from a failed RegisterResponse
type RegisterResponse ¶ added in v0.7.0
type RegisterResponse struct { ErrorData RegisterError `json:"error"` SuccessData RegisterSuccess `json:"success"` }
RegisterResponse represent the response from registering a username
type RegisterSuccess ¶ added in v0.7.0
type RegisterSuccess struct {
Username string `json:"username"`
}
RegisterSuccess represent the data from a succeeded RegisterResponse