remote

package
v0.0.0-...-c6e5042 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2013 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Library functions for working with HUE

Index

Constants

This section is empty.

Variables

View Source
var DefaultAction = LightAction{
	LightState: LightState{On: true},
	Transition: 1,
}
View Source
var DefaultState = LightState{
	On: true,
}

Functions

func AllOn

func AllOn()

func ConvertJsonToMap

func ConvertJsonToMap(b io.Reader) (m map[string]interface{}, ok bool)

func Delay

func Delay(millis int64)

func DoPut

func DoPut(url string, data io.Reader)

func DoStep

func DoStep(min, max, step int, action Action)

func GetHueIp

func GetHueIp() string

func GetStatus

func GetStatus() (string, error)

func LightLoop

func LightLoop(reps int)

func SetGroupState

func SetGroupState(s interface{})

func SetLightState

func SetLightState(lightnum int, s interface{})

func Show

func Show()

func ToggleLight

func ToggleLight(lightnum int)

func TurnLightOn

func TurnLightOn()

Types

type Action

type Action func(val int)

func GroupSet

func GroupSet(setter SetProperty) Action

type LightAction

type LightAction struct {
	LightState
	Transition int `json:"transitiontime,omitempty"`
}

func SetHue

func SetHue(val int) LightAction

type LightMessage

type LightMessage struct {
	State LightState
	Name  string
}

type LightState

type LightState struct {
	On        bool      `json:"on"`
	Bri       int       `json:"bri,omitempty"`
	Hue       int       `json:"hue,omitempty"`
	Sat       int       `json:"sat,omitempty"`
	Xy        []float64 `json:"xy,omitempty"`
	Alert     string    `json:"alert,omitempty"`
	Effect    string    `json:"effect,omitempty"`
	Colormode string    `json:"colormode,omitempty"`
	Reachable bool      `json:"reachable,omitempty"`
}

func GetLightStatus

func GetLightStatus(lightnum int) LightState

func SetBri

func SetBri(val int) LightState

func SetSat

func SetSat(val int) LightState

func (LightState) GetHSB

func (l LightState) GetHSB() color.HSB

func (LightState) GetRGB

func (l LightState) GetRGB() color.RGB

type SetProperty

type SetProperty func(val int) LightAction

type StatusMessage

type StatusMessage struct {
	Config    map[string]interface{}
	Lights    map[string]LightMessage
	Groups    map[string]interface{}
	Schedules map[string]interface{}
	Scenes    map[string]interface{}
}

func GetStatusMsg

func GetStatusMsg() StatusMessage

Jump to

Keyboard shortcuts

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