ziggy

package
v0.0.0-...-34c6a2e Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Lucifer = Meta{
	Bridges: make(map[string]*Bridge),
	RWMutex: &sync.RWMutex{},
}

Lucifer is the lightbringer.

Functions

func Assert

func Assert(ctx context.Context, l *HueLight, mode ToggleMode) error

func GetGroupMap

func GetGroupMap() map[string]*HueGroup

func GetLightMap

func GetLightMap() map[string]*HueLight

func GetSceneMap

func GetSceneMap() map[string]*HueScene

func GetSensorMap

func GetSensorMap() map[string]*HueSensor

func NeedsUpdate

func NeedsUpdate()

Types

type Bridge

type Bridge struct {
	Info *huego.Config

	HueLights []*HueLight
	*huego.Bridge
	*sync.RWMutex
	// contains filtered or unexported fields
}

Bridge represents a zigbee light controller. Just hue for now.

func GetControllers

func GetControllers(bridges []config.KnownBridge) (br []*Bridge)

func Setup

func Setup() (known []*Bridge, err error)

func (*Bridge) FindGroup

func (c *Bridge) FindGroup(input string) (light *HueGroup, err error)

func (*Bridge) FindLight

func (c *Bridge) FindLight(input string) (light *HueLight, err error)

func (*Bridge) FindSensor

func (c *Bridge) FindSensor(input string) (light *HueSensor, err error)

func (*Bridge) Lights

func (c *Bridge) Lights() []*HueLight

func (*Bridge) Log

func (c *Bridge) Log() *zerolog.Logger

func (*Bridge) Run

func (c *Bridge) Run(e *zerolog.Event, level zerolog.Level, msg string)

type HueGroup

type HueGroup struct {
	*huego.Group
	// contains filtered or unexported fields
}

func (*HueGroup) Scenes

func (hg *HueGroup) Scenes() ([]*HueScene, error)

type HueLight

type HueLight struct {
	*huego.Light
	// contains filtered or unexported fields
}

func (*HueLight) GetPtr

func (hl *HueLight) GetPtr() (*huego.Light, error)

func (*HueLight) Log

func (hl *HueLight) Log() *zerolog.Logger

func (*HueLight) Scene

func (hl *HueLight) Scene(s string) error

type HueScene

type HueScene struct {
	*huego.Scene
	// contains filtered or unexported fields
}

type HueSensor

type HueSensor struct {
	*huego.Sensor
	// contains filtered or unexported fields
}

func (*HueSensor) Rename

func (hs *HueSensor) Rename(name string) error

type Meta

type Meta struct {
	Bridges map[string]*Bridge
	*sync.RWMutex
}

type Multiplex

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

Multiplex is all of the lights (all of the lights). I'll see myself out.

type ToggleMode

type ToggleMode uint8
const (
	ToggleOn ToggleMode = iota
	ToggleOff
	ToggleRainbow
	Toggle
)

Jump to

Keyboard shortcuts

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