lights

package
v0.0.0-...-b335d8f Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: MIT Imports: 8 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Light

type Light struct {
	ID        int    `json:"id,omitempty"`
	Name      string `json:"name"`
	State     State  `json:"state,omitempty"`
	Type      string `json:"type,omitempty"`
	ModelID   string `json:"modelid,omitempty"`
	SWVersion string `json:"swversion,omitempty"`
}

func (*Light) String

func (l *Light) String() string

type Lights

type Lights struct {
	Hostname string
	Username string
}

func New

func New(hostname string, username string) *Lights

func (*Lights) GetAllLights

func (l *Lights) GetAllLights() ([]Light, error)

func (*Lights) GetLight

func (l *Lights) GetLight(lightID int) (Light, error)

func (*Lights) RenameLight

func (l *Lights) RenameLight(lightID int, lightName string) ([]hue.ApiResponse, error)

func (*Lights) SetLightState

func (l *Lights) SetLightState(lightID int, state State) ([]hue.ApiResponse, error)

type State

type State struct {
	On             bool      `json:"on"`
	Hue            uint16    `json:"hue,omitempty"`
	Effect         string    `json:"effect,omitempty"`
	Bri            uint8     `json:"bri,omitempty"`
	Sat            uint8     `json:"sat,omitempty"`
	CT             uint16    `json:"ct,omitempty"`
	XY             []float32 `json:"xy,omitempty"`
	Alert          string    `json:"alert,omitempty"`
	TransitionTime uint16    `json:"transitiontime,omitempty"`
	Reachable      bool      `json:"reachable,omitempty"`
	ColorMode      string    `json:"colormode,omitempty"`
}

func (*State) String

func (s *State) String() string

Jump to

Keyboard shortcuts

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