wled

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	On       = "ON"
	Off      = "OFF"
	Toggle   = "T"
	TopicAll = "wled/all"
)

Functions

This section is empty.

Types

type LightInfo

type LightInfo struct {
	State struct {
		On         bool `json:"on,omitempty"`
		Bri        int  `json:"bri,omitempty"`
		Transition int  `json:"transition,omitempty"`
		Ps         int  `json:"ps,omitempty"`
		Pl         int  `json:"pl,omitempty"`
		Nl         struct {
			On   bool `json:"on,omitempty"`
			Dur  int  `json:"dur,omitempty"`
			Fade bool `json:"fade,omitempty"`
			Tbri int  `json:"tbri,omitempty"`
		} `json:"nl,omitempty"`
		Udpn struct {
			Send bool `json:"send,omitempty"`
			Recv bool `json:"recv,omitempty"`
		} `json:"udpn,omitempty"`
		Seg []struct {
			Start int     `json:"start,omitempty"`
			Stop  int     `json:"stop,omitempty"`
			Len   int     `json:"len,omitempty"`
			Col   [][]int `json:"col,omitempty"`
			Fx    int     `json:"fx,omitempty"`
			Sx    int     `json:"sx,omitempty"`
			Ix    int     `json:"ix,omitempty"`
			Pal   int     `json:"pal,omitempty"`
			Sel   bool    `json:"sel,omitempty"`
			Rev   bool    `json:"rev,omitempty"`
			Cln   int     `json:"cln,omitempty"`
		} `json:"seg,omitempty"`
	} `json:"state,omitempty"`
	Info struct {
		Ver  string `json:"ver,omitempty"`
		Vid  int    `json:"vid,omitempty"`
		Leds struct {
			Count  int   `json:"count,omitempty"`
			Rgbw   bool  `json:"rgbw,omitempty"`
			Pin    []int `json:"pin,omitempty"`
			Pwr    int   `json:"pwr,omitempty"`
			Maxpwr int   `json:"maxpwr,omitempty"`
			Maxseg int   `json:"maxseg,omitempty"`
		} `json:"leds,omitempty"`
		Name     string `json:"name,omitempty"`
		Udpport  int    `json:"udpport,omitempty"`
		Live     bool   `json:"live,omitempty"`
		Fxcount  int    `json:"fxcount,omitempty"`
		Palcount int    `json:"palcount,omitempty"`
		Arch     string `json:"arch,omitempty"`
		Core     string `json:"core,omitempty"`
		Freeheap int    `json:"freeheap,omitempty"`
		Uptime   int    `json:"uptime,omitempty"`
		Opt      int    `json:"opt,omitempty"`
		Brand    string `json:"brand,omitempty"`
		Product  string `json:"product,omitempty"`
		Btype    string `json:"btype,omitempty"`
		Mac      string `json:"mac,omitempty"`
	} `json:"info,omitempty"`
	Effects  []string `json:"effects,omitempty"`
	Palettes []string `json:"palettes,omitempty"`
}

type WLed

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

func New

func New(i *iot.IoT) *WLed

func (*WLed) Brightness

func (w *WLed) Brightness(topic string, value int64) error

func (*WLed) Color

func (w *WLed) Color(topic string, value string) error

func (*WLed) Off

func (w *WLed) Off(topic string) error

func (*WLed) On

func (w *WLed) On(topic string) error

func (*WLed) PulseN

func (w *WLed) PulseN(topic string, pulse int) error

func (*WLed) Toggle

func (w *WLed) Toggle(topic string) error

Jump to

Keyboard shortcuts

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