wled

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = OpConfig{Connections: map[string]WLEDConfig{}, DefaultConnection: "default"}

Functions

This section is empty.

Types

type AnimationOptions

type AnimationOptions struct {
	AnimationType        string
	StepDurationInMillis int `json:",string"`
	Repeat               int `json:",string"`
}

type ConnectionReference added in v1.3.0

type ConnectionReference struct {
	Name    string
	OffsetX int
	OffsetY int
}

type OpConfig

type OpConfig struct {
	Connections       map[string]WLEDConfig
	DefaultConnection string
}

type OpWLED

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

func NewWLEDOp

func NewWLEDOp(cr *utils.ConfigReader) *OpWLED

func (*OpWLED) Execute

func (o *OpWLED) Execute(ctx *base.Context, function string, vars map[string]string, mainInput *base.OperatorIO) *base.OperatorIO

func (*OpWLED) GetArgSuggestions

func (o *OpWLED) GetArgSuggestions(fn string, arg string, otherArgs map[string]string) map[string]string

func (*OpWLED) GetFunctions

func (o *OpWLED) GetFunctions() []string

func (*OpWLED) GetHook added in v1.3.0

func (o *OpWLED) GetHook() interface{}

GetHook (noOp)

func (*OpWLED) GetName

func (o *OpWLED) GetName() string

GetName returns the name of the operator

func (*OpWLED) GetPossibleArgs

func (o *OpWLED) GetPossibleArgs(fn string) []string

func (*OpWLED) SetPixelMatrix

func (o *OpWLED) SetPixelMatrix(w *WLEDConverter, pmName string, animate AnimationOptions) *base.OperatorIO

func (*OpWLED) Shutdown

func (o *OpWLED) Shutdown(ctx *base.Context)

Shutdown (noOp)

func (*OpWLED) StartListening added in v1.3.0

func (o *OpWLED) StartListening(ctx *base.Context)

StartListening (noOp)

type PixelMatrix

type PixelMatrix [][]string

func MakeDiagonalPixelMatrix

func MakeDiagonalPixelMatrix(width int, height int, color string, bgcol string) PixelMatrix

func MakeZigZagPixelMatrix added in v1.3.0

func MakeZigZagPixelMatrix(width int, height int, color string, bgcol string) PixelMatrix

func (PixelMatrix) MoveLeft

func (p PixelMatrix) MoveLeft(bgcol string, i int) PixelMatrix

func (PixelMatrix) MoveRight

func (p PixelMatrix) MoveRight(bgcol string, i int) PixelMatrix

func (PixelMatrix) Shift

func (p PixelMatrix) Shift(i int) PixelMatrix

type WLEDConfig

type WLEDConfig struct {
	Width   int `json:",string"`
	Height  int `json:",string"`
	SegID   int `json:",string"`
	Address string

	References []ConnectionReference
}

WLEDConfig either describes a segment or references mutlipe other segments

func (*WLEDConfig) Validate

func (c *WLEDConfig) Validate(requireNoReference bool) error

type WLEDConverter

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

func NewWLEDConverter

func NewWLEDConverter(confName string, connections map[string]WLEDConfig) (*WLEDConverter, error)

NewWLEDConverter creates a connection to one or multiple WLED instances, the config might reference other configs

func (*WLEDConverter) DrawPixelMatrix added in v1.3.0

func (w *WLEDConverter) DrawPixelMatrix(pm PixelMatrix) error

func (*WLEDConverter) GetPNG

func (w *WLEDConverter) GetPNG() *base.OperatorIO

func (*WLEDConverter) GetPixelMatrix

func (w *WLEDConverter) GetPixelMatrix() PixelMatrix

func (*WLEDConverter) Height added in v1.3.0

func (w *WLEDConverter) Height() int

func (*WLEDConverter) PrepareStore added in v1.3.0

func (w *WLEDConverter) PrepareStore() error

func (*WLEDConverter) ScaleImage

func (w *WLEDConverter) ScaleImage(src image.Image)

func (*WLEDConverter) SendToWLED

func (w *WLEDConverter) SendToWLED(cmd *base.OperatorIO, returnPNG bool) *base.OperatorIO

SendToWLED sends a command to WLED, if cmd is nil, it sends the stored picture instead

func (*WLEDConverter) SetPixel

func (w *WLEDConverter) SetPixel(x, y int, c color.Color) error

func (*WLEDConverter) SetPixelMatrix

func (w *WLEDConverter) SetPixelMatrix(pmName string) error

func (*WLEDConverter) StorePixelMatrix added in v1.3.0

func (w *WLEDConverter) StorePixelMatrix(ctx *base.Context, pmName string) error

func (*WLEDConverter) Width added in v1.3.0

func (w *WLEDConverter) Width() int

func (*WLEDConverter) WriteString

func (w *WLEDConverter) WriteString(s string, c color.Color, alignRight bool) error

type WLEDRoot

type WLEDRoot struct {
	Seg WLEDSegment `json:"seg,omitempty"`
	// contains filtered or unexported fields
}

func (*WLEDRoot) Height added in v1.3.0

func (root *WLEDRoot) Height() int

func (*WLEDRoot) SendToWLED added in v1.3.0

func (root *WLEDRoot) SendToWLED(cmd *base.OperatorIO, dst *image.RGBA) *base.OperatorIO

func (*WLEDRoot) SetImage added in v1.3.0

func (root *WLEDRoot) SetImage(dst *image.RGBA) ([]byte, error)

func (*WLEDRoot) Width added in v1.3.0

func (root *WLEDRoot) Width() int

type WLEDSegment

type WLEDSegment struct {
	ID int         `json:"id"`
	I  [][3]uint32 `json:"i"`
}

type WLEDState added in v1.3.0

type WLEDState struct {
	On bool `json:"on"`
	V  bool `json:"v"`
}

Jump to

Keyboard shortcuts

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