lights

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllLightsOff

func AllLightsOff() error

func AllLightsOn

func AllLightsOn() error

func DeleteScene

func DeleteScene(id string) error

func InitScenes

func InitScenes(configPath string) error

func LightOff

func LightOff(mac string) error

func LightOn

func LightOn(mac string) error

func LoadLights

func LoadLights() error

func LoadScenes

func LoadScenes() error

func ModifyScene

func ModifyScene(req SceneSaveRequest) error

func RefreshLight

func RefreshLight(mac string) error

func RefreshLights

func RefreshLights() error

func SaveScene

func SaveScene(req SceneSaveRequest) error

TODO Rename this to New

func SetColour

func SetColour(mac string, hue int, saturation int, brightness int, kelvin int, duration int) error

func TriggerScene

func TriggerScene(id string) error

Types

type Light

type Light struct {
	// contains filtered or unexported fields
}

Types

type LightResponse

type LightResponse struct {
	Mac    string      `json:"mac"`
	Name   string      `json:"name"`
	State  bool        `json:"state"`
	Colour golifx.HSBK `json:"colour"`
	Group  string      `json:"group"`
}

func ListAllLights

func ListAllLights() []LightResponse

type Lights

type Lights []*Light

func (Lights) FindLight

func (l Lights) FindLight(mac string) *Light

type Scene

type Scene struct {
	ID               string        `yaml:"id"`
	SceneName        string        `yaml:"name"`
	SceneDescription string        `yaml:"description"`
	Actions          []lightAction `yaml:"actions"`
	Order            int           `yaml:"order"`
}

type SceneResponse

type SceneResponse struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Order       int      `json:"order"`
	Actions     []string `json:"actions"`
}

func ListAllScenes

func ListAllScenes() []SceneResponse

type SceneSaveRequest

type SceneSaveRequest struct {
	ID          string   `json:"ID"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Actions     []string `json:"actions"`
	Order       int      `json:"order"`
}

type Scenes

type Scenes []*Scene

Jump to

Keyboard shortcuts

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