From 6fd6eb7f0d031a66a66ab98753a3a7e7cd939d50 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Sun, 16 Jun 2019 23:47:41 +0200 Subject: [PATCH] fix(pkg/rgbled): description for exported functions --- pkg/rgbled/rgbled.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/rgbled/rgbled.go b/pkg/rgbled/rgbled.go index c1af8d6..f05dabe 100644 --- a/pkg/rgbled/rgbled.go +++ b/pkg/rgbled/rgbled.go @@ -8,6 +8,7 @@ import ( "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 { color := types.LEDColorBlue if err := operate(rgbLEDs, true, color); err != nil { @@ -16,6 +17,8 @@ func Blue(rgbLEDs []RGBLED) error { 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 { if err := operate(rgbLEDs, true, color); err != nil { return err @@ -23,6 +26,7 @@ func CustomColor(rgbLEDs []RGBLED, color types.LEDColor) error { return nil } +// Green makes all RGB-LEDs which are passed as parameters light up in green. func Green(rgbLEDs []RGBLED) error { color := types.LEDColorGreen if err := operate(rgbLEDs, true, color); err != nil { @@ -31,6 +35,7 @@ func Green(rgbLEDs []RGBLED) error { return nil } +// Off turns all RGB-LEDs which are passes as parameters off. func Off(rgbLEDs []RGBLED) error { color := types.LEDColorNone if err := operate(rgbLEDs, false, color); err != nil { @@ -39,6 +44,7 @@ func Off(rgbLEDs []RGBLED) error { return nil } +// Purple makes all RGB-LEDs which are passed as parameters light up in purple. func Purple(rgbLEDs []RGBLED) error { color := types.LEDColorPurple if err := operate(rgbLEDs, true, color); err != nil { @@ -47,6 +53,7 @@ func Purple(rgbLEDs []RGBLED) error { return nil } +// Red makes all RGB-LEDs which are passed as parameters light up in red. func Red(rgbLEDs []RGBLED) error { color := types.LEDColorRed if err := operate(rgbLEDs, true, color); err != nil { @@ -55,6 +62,8 @@ func Red(rgbLEDs []RGBLED) error { return nil } +// Turquoise makes all RGB-LEDs which are passed as parameters light up in +// turquoise. func Turquoise(rgbLEDs []RGBLED) error { color := types.LEDColorTurquoise if err := operate(rgbLEDs, true, color); err != nil { @@ -63,6 +72,7 @@ func Turquoise(rgbLEDs []RGBLED) error { return nil } +// White makes all RGB-LEDs which are passed as parameters light up in white. func White(rgbLEDs []RGBLED) error { color := types.LEDColorWhite if err := operate(rgbLEDs, true, color); err != nil { @@ -71,6 +81,7 @@ func White(rgbLEDs []RGBLED) error { return nil } +// Yellow makes all RGB-LEDs which are passed as parameters light up in yellow. func Yellow(rgbLEDs []RGBLED) error { color := types.LEDColorYellow if err := operate(rgbLEDs, true, color); err != nil {