Documentation
¶
Index ¶
- Constants
- func NewAPIParseError(expected string, actual interface{}, context string) error
- func NewHTTPClient(addr string) *client
- func NewStubClient(responseFile string) *client
- type API
- type APIError
- type APIErrorDetail
- type APIParseError
- type APIResult
- type APISuccessDetail
- type AdminAPI
- type Bridge
- type Configuration
- type Light
- type LightAttributes
- type LightState
- type SoftwareUpdateInfo
- type User
- func (u *User) GetConfiguration() (*Configuration, error)
- func (u *User) GetLightAttributes(lightId string) (*LightAttributes, error)
- func (u *User) GetLights() ([]Light, error)
- func (u *User) GetNewLights() ([]Light, time.Time, error)
- func (u *User) SearchForNewLights() error
- func (u *User) SetGroupState(groupId string, state *LightState) error
- func (u *User) SetLightName(lightId string, name string) error
- func (u *User) SetLightState(lightId string, state *LightState) error
Constants ¶
View Source
const ( InvalidJsonErrorType = 2 ResourceNotAvailableErrorType = 3 MethodNotAvailableErrorType = 4 MissingParameterErrorType = 5 ParameterNotAvailableErrorType = 6 InvalidParameterValueErrorType = 7 ParameterNotModifiableErrorType = 8 InternalErrorType = 901 LinkButtonNotPressedErrorType = 101 DeviceIsOffErrorType = 201 GroupTableFullErrorType = 301 DeviceGroupTableFullErrorType = 302 )
View Source
const AllLightsGroupId = "0"
The group id for all lights on a bridge
View Source
const HueModelURL = "http://www.meethue.com"
Variables ¶
This section is empty.
Functions ¶
func NewAPIParseError ¶
func NewHTTPClient ¶
func NewHTTPClient(addr string) *client
func NewStubClient ¶
func NewStubClient(responseFile string) *client
Types ¶
type API ¶
type API interface {
GetLights() ([]Light, error)
GetNewLights() ([]Light, time.Time, error)
SearchForNewLights() error
GetLightAttributes(lightId string) (*LightAttributes, error)
SetLightName(lightId string, name string) error
SetLightState(lightId string, state *LightState) error
SetGroupState(groupId string, state *LightState) error
}
type APIError ¶
type APIError struct {
Errors []APIErrorDetail
}
type APIErrorDetail ¶
type APIErrorDetail struct {
Type int `json:"type"`
Address string `json:"address"`
Description string `json:"description"`
}
func (APIErrorDetail) Error ¶
func (e APIErrorDetail) Error() string
type APIParseError ¶
func (*APIParseError) Error ¶
func (e *APIParseError) Error() string
type APIResult ¶
type APIResult struct {
Success *APISuccessDetail `json:"success"`
Error *APIErrorDetail `json:"error"`
}
type APISuccessDetail ¶
type APISuccessDetail map[string]interface{}
type AdminAPI ¶
type AdminAPI interface {
GetConfiguration() (*Configuration, error)
}
type Bridge ¶
type Bridge struct {
UniqueId string
// contains filtered or unexported fields
}
func FindBridges ¶
func FindBridgesUsingCloud ¶
func NewStubBridge ¶
type Configuration ¶
type Configuration struct {
// Read and Write
Name string `json:"name,omitempty"`
ProxyAddress string `json:"proxyaddress,omitempty"`
ProxyPort *uint16 `json:"proxyport,omitempty"`
IPAddress string `json:"ipaddress,omitempty"`
Netmask string `json:"netmask,omitempty"`
Gateway string `json:"gateway,omitempty"`
DHCP *bool `json:"dhcp,omitempty"`
PortalServices *bool `json:"portalservices,omitempty"`
LinkButton *bool `json:"linkbutton,omitempty"`
SoftwareUpdate *SoftwareUpdateInfo `json:"swupdate,omitempty"`
// Read only
UTC string `json:"utc,omitempty"`
Whitelist map[string]map[string]string `json:"whitelist,omitempty"`
SoftwareVersion string `json:"swversion,omitempty"`
MAC string `json:"mac,omitempty"`
}
type LightAttributes ¶
type LightAttributes struct {
Name string `json:"name"`
State *LightState `json:"state"`
Type string `json:"type"`
ModelId string `json:"modelid"`
SoftwareVersion string `json:"swversion"`
PointSymbol interface{} `json:"pointsymbol"`
}
type LightState ¶
type LightState struct {
On *bool `json:"on,omitempty"`
Brightness *uint8 `json:"bri,omitempty"`
Hue *uint16 `json:"hue,omitempty"`
Saturation *uint8 `json:"sat,omitempty"`
XY []float64 `json:"xy,omitempty"`
ColorTemp *uint16 `json:"ct,omitempty"`
Alert string `json:"alert,omitempty"`
Effect string `json:"effect,omitempty"`
TransitionTime *uint16 `json:"transitiontime,omitempty"` /* write only */
ColorMode string `json:"colormode,omitempty"` /* read only */
Reachable bool `json:"reachable,omitempty"` /* read only */
}
type SoftwareUpdateInfo ¶
type User ¶
func NewStubUser ¶
func NewUserWithBridge ¶
func (*User) GetConfiguration ¶
func (u *User) GetConfiguration() (*Configuration, error)
func (*User) GetLightAttributes ¶
func (u *User) GetLightAttributes(lightId string) (*LightAttributes, error)
func (*User) SearchForNewLights ¶
func (*User) SetGroupState ¶
func (u *User) SetGroupState(groupId string, state *LightState) error
func (*User) SetLightState ¶
func (u *User) SetLightState(lightId string, state *LightState) error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package with a Stub API that conforms to the hue.API interface for testing purposes.
|
Package with a Stub API that conforms to the hue.API interface for testing purposes. |
|
Package with a LightStrand that implementes the hue.API interface.
|
Package with a LightStrand that implementes the hue.API interface. |
|
example
command
Examples of using strand
|
Examples of using strand |
Click to show internal directories.
Click to hide internal directories.