fix(pkg/rgbled): use action maps to turn on/off led colors
This commit is contained in:
@ -184,10 +184,16 @@ func PrintRGBLEDs(cnf *config.Configuration, w io.Writer) {
|
||||
tw := tabwriter.NewWriter(w, 0, 0, 3, ' ', 0)
|
||||
|
||||
// headline
|
||||
fmt.Fprintln(tw, "name\tlocation\tblue\tgreen\tred\tenabled")
|
||||
fmt.Fprintln(tw, "name\tlocation\tblue\tgreen\tred\tenabled\taction")
|
||||
|
||||
for _, rgbled := range cnf.RGBLEDs {
|
||||
fmt.Fprintf(tw, "%v\t%v\t%v\t%v\t%v\t%v\n", rgbled.RGBLEDName, rgbled.RGBLEDLocation, *rgbled.BaseColorsToGPIO[types.BaseColorBlue], *rgbled.BaseColorsToGPIO[types.BaseColorGreen], *rgbled.BaseColorsToGPIO[types.BaseColorRed], rgbled.RGBLEDEnabled)
|
||||
fmt.Fprintf(tw, "%v\t%v\t%v\t%v\t%v\t%v\t", rgbled.RGBLEDName, rgbled.RGBLEDLocation, *rgbled.BaseColorsToGPIO[types.BaseColorBlue], *rgbled.BaseColorsToGPIO[types.BaseColorGreen], *rgbled.BaseColorsToGPIO[types.BaseColorRed], rgbled.RGBLEDEnabled)
|
||||
|
||||
for action, color := range rgbled.ActionMapping {
|
||||
fmt.Fprintf(tw, "%v=%v,", action, color)
|
||||
}
|
||||
|
||||
fmt.Fprintf(tw, "\n")
|
||||
}
|
||||
|
||||
tw.Flush()
|
||||
|
Reference in New Issue
Block a user