utils package - github.com/dsdeboer/slack-luxafor-utils - Go Packages

utils

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: MIT Imports: 6 Imported by: 1

README

This repository contains a collection of utility scripts purely for usage with our slack-luxafor applications.

Documentation

Overview

Copyright © 2025 Duncan de Boer <duncan.d.boer@gmail.com> This file is part of CLI application slack-luxafor.

Copyright © 2025 Duncan de Boer <duncan.d.boer@gmail.com> This file is part of CLI application slack-luxafor.

Copyright © 2025 Duncan de Boer <duncan.d.boer@gmail.com> This file is part of CLI application slack-luxafor.

Copyright © 2025 Duncan de Boer <duncan.d.boer@gmail.com> This file is part of CLI application slack-luxafor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertStatusToColor

func ConvertStatusToColor(s string) string

ConvertStatusToColor converts a status to a color.

func IsValidColor

func IsValidColor(s string) bool

IsValidColor checks if the color is valid.

func IsValidStatus

func IsValidStatus(s string) bool

IsValidStatus checks if the status is valid.

func MustGetenv

func MustGetenv(key string) (string, error)

MustGetenv retrieves the value of the environment variable named by the key.

func ShutdownLight

func ShutdownLight() error

func UpdateSlackStatus

func UpdateSlackStatus(status, message string) error

func UpdateStatusLight

func UpdateStatusLight(color string) error

Types

type COMMAND

type COMMAND byte

type LED

type LED byte
const (
	All LED = 255
)

type Luxafor

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

Luxafor is used to access the devices.

func Enumerate

func Enumerate() []Luxafor

Enumerate returns a slice of attached Luxafors

func (Luxafor) Off

func (lux Luxafor) Off() (err error)

Off turns off the luxafor.

func (Luxafor) Set

func (lux Luxafor) Set(led LED, r, g, b uint8) (err error)

Set sets a golux.LED to the specific RGB value.

func (Luxafor) Sets

func (lux Luxafor) Sets(leds []LED, r, g, b uint8) (err error)

Sets sets multiple golux.LED to the specific RGB value.

func (Luxafor) Solid

func (lux Luxafor) Solid(r, g, b uint8) (err error)

Solid turns the specified luxafor into a solid RGB color.

Jump to

Keyboard shortcuts

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