fix(pkg/rgbled): description for exported functions

This commit is contained in:
Markus Pesch 2019-06-16 23:47:41 +02:00
parent b2bd4f8fe6
commit 6fd6eb7f0d
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982

View File

@ -8,6 +8,7 @@ import (
"github.com/go-flucky/flucky/pkg/types" "github.com/go-flucky/flucky/pkg/types"
) )
// Blue makes all RGB-LEDs which are passed as parameters light up blue.
func Blue(rgbLEDs []RGBLED) error { func Blue(rgbLEDs []RGBLED) error {
color := types.LEDColorBlue color := types.LEDColorBlue
if err := operate(rgbLEDs, true, color); err != nil { if err := operate(rgbLEDs, true, color); err != nil {
@ -16,6 +17,8 @@ func Blue(rgbLEDs []RGBLED) error {
return nil return nil
} }
// CustomColor makes all RGB-LEDs which are passed as parameters light up in
// custom color.
func CustomColor(rgbLEDs []RGBLED, color types.LEDColor) error { func CustomColor(rgbLEDs []RGBLED, color types.LEDColor) error {
if err := operate(rgbLEDs, true, color); err != nil { if err := operate(rgbLEDs, true, color); err != nil {
return err return err
@ -23,6 +26,7 @@ func CustomColor(rgbLEDs []RGBLED, color types.LEDColor) error {
return nil return nil
} }
// Green makes all RGB-LEDs which are passed as parameters light up in green.
func Green(rgbLEDs []RGBLED) error { func Green(rgbLEDs []RGBLED) error {
color := types.LEDColorGreen color := types.LEDColorGreen
if err := operate(rgbLEDs, true, color); err != nil { if err := operate(rgbLEDs, true, color); err != nil {
@ -31,6 +35,7 @@ func Green(rgbLEDs []RGBLED) error {
return nil return nil
} }
// Off turns all RGB-LEDs which are passes as parameters off.
func Off(rgbLEDs []RGBLED) error { func Off(rgbLEDs []RGBLED) error {
color := types.LEDColorNone color := types.LEDColorNone
if err := operate(rgbLEDs, false, color); err != nil { if err := operate(rgbLEDs, false, color); err != nil {
@ -39,6 +44,7 @@ func Off(rgbLEDs []RGBLED) error {
return nil return nil
} }
// Purple makes all RGB-LEDs which are passed as parameters light up in purple.
func Purple(rgbLEDs []RGBLED) error { func Purple(rgbLEDs []RGBLED) error {
color := types.LEDColorPurple color := types.LEDColorPurple
if err := operate(rgbLEDs, true, color); err != nil { if err := operate(rgbLEDs, true, color); err != nil {
@ -47,6 +53,7 @@ func Purple(rgbLEDs []RGBLED) error {
return nil return nil
} }
// Red makes all RGB-LEDs which are passed as parameters light up in red.
func Red(rgbLEDs []RGBLED) error { func Red(rgbLEDs []RGBLED) error {
color := types.LEDColorRed color := types.LEDColorRed
if err := operate(rgbLEDs, true, color); err != nil { if err := operate(rgbLEDs, true, color); err != nil {
@ -55,6 +62,8 @@ func Red(rgbLEDs []RGBLED) error {
return nil return nil
} }
// Turquoise makes all RGB-LEDs which are passed as parameters light up in
// turquoise.
func Turquoise(rgbLEDs []RGBLED) error { func Turquoise(rgbLEDs []RGBLED) error {
color := types.LEDColorTurquoise color := types.LEDColorTurquoise
if err := operate(rgbLEDs, true, color); err != nil { if err := operate(rgbLEDs, true, color); err != nil {
@ -63,6 +72,7 @@ func Turquoise(rgbLEDs []RGBLED) error {
return nil return nil
} }
// White makes all RGB-LEDs which are passed as parameters light up in white.
func White(rgbLEDs []RGBLED) error { func White(rgbLEDs []RGBLED) error {
color := types.LEDColorWhite color := types.LEDColorWhite
if err := operate(rgbLEDs, true, color); err != nil { if err := operate(rgbLEDs, true, color); err != nil {
@ -71,6 +81,7 @@ func White(rgbLEDs []RGBLED) error {
return nil return nil
} }
// Yellow makes all RGB-LEDs which are passed as parameters light up in yellow.
func Yellow(rgbLEDs []RGBLED) error { func Yellow(rgbLEDs []RGBLED) error {
color := types.LEDColorYellow color := types.LEDColorYellow
if err := operate(rgbLEDs, true, color); err != nil { if err := operate(rgbLEDs, true, color); err != nil {