keylight

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type Info

type Info struct {
	ProductName         string   `json:"productName"`
	HardwareBoardType   int      `json:"hardwareBoardType"`
	FirmwareBuildNumber int      `json:"firmwareBuildNumber"`
	FirmwareVersion     string   `json:"firmwareVersion"`
	SerialNumber        string   `json:"serialNumber"`
	DisplayName         string   `json:"displayName"`
	Features            []string `json:"features"`
}

type Lights

type Lights struct {
	NumberOfLights int     `json:"numberOfLights"`
	Lights         []State `json:"lights"`
}

type Manager

type Manager struct {
	Endpoints  []string
	State      map[string]State
	Info       map[string]Info
	Settings   map[string]Settings
	HTTPClient HTTPClient
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) Discover

func (m *Manager) Discover() ([]string, error)

func (*Manager) LoadInfo

func (m *Manager) LoadInfo() error

func (*Manager) LoadSettings

func (m *Manager) LoadSettings() error

func (*Manager) LoadState

func (m *Manager) LoadState() error

func (*Manager) UpdateState

func (m *Manager) UpdateState(endpoint string, on, brightness, temp int) error

type Settings

type Settings struct {
	PowerOnBehavior       int `json:"powerOnBehavior"`
	PowerOnBrightness     int `json:"powerOnBrightness"`
	PowerOnTemperature    int `json:"powerOnTemperature"`
	SwitchOnDurationMs    int `json:"switchOnDurationMs"`
	SwitchOffDurationMs   int `json:"switchOffDurationMs"`
	ColorChangeDurationMs int `json:"colorChangeDurationMs"`
}

type State

type State struct {
	On          int `json:"on"`
	Brightness  int `json:"brightness"`
	Temperature int `json:"temperature"`
}

Jump to

Keyboard shortcuts

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