app

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBulbNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Bulb

type Bulb struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Addr string `json:"addr"`
}

type BulbFileStore

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

func NewBulbFileStore

func NewBulbFileStore(dir string) *BulbFileStore

func (*BulbFileStore) All

func (b *BulbFileStore) All() []Bulb

func (*BulbFileStore) AllNames

func (b *BulbFileStore) AllNames() []string

func (*BulbFileStore) Delete

func (b *BulbFileStore) Delete(bulb Bulb)

func (*BulbFileStore) FindByID

func (b *BulbFileStore) FindByID(id string) (Bulb, error)

func (*BulbFileStore) FindByName

func (b *BulbFileStore) FindByName(name string) (Bulb, error)

func (*BulbFileStore) Flush

func (b *BulbFileStore) Flush() error

func (*BulbFileStore) Init

func (b *BulbFileStore) Init() error

func (*BulbFileStore) Save

func (b *BulbFileStore) Save(bulb Bulb)

type Control

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

func NewControl

func NewControl(store *BulbFileStore, printer Printer) *Control

func (*Control) BackgroundToggle

func (c *Control) BackgroundToggle(name string) (err error)

func (*Control) Info

func (c *Control) Info(name string) (err error)

func (*Control) PowerToggle

func (c *Control) PowerToggle(name string) (err error)

func (*Control) SetBackgroundBright

func (c *Control) SetBackgroundBright(name string, value int, effect yeelight.Effect, duration int) (err error)

func (*Control) SetBackgroundRGB

func (c *Control) SetBackgroundRGB(name string, value int, effect yeelight.Effect, duration int) (err error)

func (*Control) SetBackgroundTemperature

func (c *Control) SetBackgroundTemperature(name string, value int, effect yeelight.Effect, duration int) (err error)

func (*Control) SetBright

func (c *Control) SetBright(name string, value int, effect yeelight.Effect, duration int) (err error)

func (*Control) SetRGB

func (c *Control) SetRGB(name string, value int, effect yeelight.Effect, duration int) (err error)

func (*Control) SetTemperature

func (c *Control) SetTemperature(name string, value int, effect yeelight.Effect, duration int) (err error)

type Manager

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

func NewManager

func NewManager(store *BulbFileStore, names *pokemon.Names, printer Printer) *Manager

func (*Manager) Delete

func (m *Manager) Delete(name string) error

func (*Manager) Discover

func (m *Manager) Discover(listen string, duration time.Duration) error

func (*Manager) List

func (m *Manager) List() error

type Printer

type Printer interface {
	Println(args ...any)
	Printf(format string, args ...any)
}

Jump to

Keyboard shortcuts

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