ledbutton

package
v0.0.0-...-1a7d465 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LedColor

func LedColor(color LEDColor) func(*LedButton)

LedColor is a functional option to set the color of the LED.

func State

func State(on bool) func(*LedButton)

State is a functional option for providing the initial state of the LED Button.

func Text

func Text(text string) func(*LedButton)

Text is a functional option for providing the initial text on the LED Button. Max 5 characters.

func TextColor

func TextColor(c color.Color) func(*LedButton)

TextColor is a functional option which sets the text color.

Types

type LEDColor

type LEDColor int

LEDColor is the type which defines the colors of the LED

const (
	//LEDRed is a red LED
	LEDRed LEDColor = iota
	// LEDGreen is a green LED
	LEDGreen
	// LEDYellow is a yellow LED
	LEDYellow
	// LEDOff turns the LED off
	LEDOff
)

type LedButton

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

LedButton simulates a Button with a status LED.

func NewLedButton

func NewLedButton(sd *sd.StreamDeck, id int, options ...func(*LedButton)) (*LedButton, error)

NewLedButton is the constructor for a new Led Button. Functional arguments can be supplied to modify it's default characteristics

func (*LedButton) Change

func (btn *LedButton) Change(state sd.BtnState)

Change button state

func (*LedButton) Draw

func (btn *LedButton) Draw() error

Draw renders the Button

func (*LedButton) SetState

func (btn *LedButton) SetState(state bool)

SetState sets the state of the LED. In order to render the changes Draw() has to be called.

func (*LedButton) SetText

func (btn *LedButton) SetText(text string)

SetText sets the text (max 5 Chars) on the LedButton. In order to render the changes Draw() has to be called.

func (*LedButton) SetTextColor

func (btn *LedButton) SetTextColor(textColor color.Color)

SetTextColor sets the text color of the button. In order to render the changes Draw() has to be called.

func (*LedButton) State

func (btn *LedButton) State() bool

State returns the state of the LED

Jump to

Keyboard shortcuts

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