client

package
v0.0.0-...-efff322 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package client is a fork of github.com/captncraig/aurora.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Disocver

func Disocver(d time.Duration) ([]string, error)

Types

type AuroraClient

type AuroraClient interface {
	Authorize() (string, error)
	GetInfo() (*HardwareInfo, error)
	SetPanelColor(panel, r, g, b byte) error
	Stop() error
}

func New

func New(address string) (AuroraClient, error)

New creates a new client.

func NewWithToken

func NewWithToken(address, token string) (AuroraClient, error)

NewWithToken creates a new client with a provided token.

type ExternalCommand

type ExternalCommand interface {
	Execute(panel, r, g, b byte) error
	Stop() error
}

func NewExternalCommander

func NewExternalCommander(address string) ExternalCommand

type HardwareInfo

type HardwareInfo struct {
	Name            string `json:"name"`
	SerialNo        string `json:"serialNo"`
	Manufacturer    string `json:"manufacturer"`
	FirmwareVersion string `json:"firmwareVersion"`
	Model           string `json:"model"`
	State           struct {
		On struct {
			Value bool `json:"value"`
		} `json:"on"`
		Brightness struct {
			Value int `json:"value"`
			Max   int `json:"max"`
			Min   int `json:"min"`
		} `json:"brightness"`
		Hue struct {
			Value int `json:"value"`
			Max   int `json:"max"`
			Min   int `json:"min"`
		} `json:"hue"`
		Sat struct {
			Value int `json:"value"`
			Max   int `json:"max"`
			Min   int `json:"min"`
		} `json:"sat"`
		Ct struct {
			Value int `json:"value"`
			Max   int `json:"max"`
			Min   int `json:"min"`
		} `json:"ct"`
		ColorMode string `json:"colorMode"`
	} `json:"state"`
	Effects struct {
		Select string   `json:"select"`
		List   []string `json:"list"`
	} `json:"effects"`
	Panels      []*Panel `json:"panels"`
	PanelLayout struct {
		Layout struct {
			LayoutData string `json:"layoutData"`
		} `json:"layout"`
		GlobalOrientation struct {
			Value int `json:"value"`
			Max   int `json:"max"`
			Min   int `json:"min"`
		} `json:"globalOrientation"`
	} `json:"panelLayout"`
}

type Panel

type Panel struct {
	ID         int `json:"id"`
	X          int `json:"x"`
	Y          int `json:"y"`
	Rotation   int `json:"rotation"`
	SideLength int `json:"length"`
}

type PanelColorCommand

type PanelColorCommand struct {
	ID, R, G, B byte
}

Jump to

Keyboard shortcuts

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