fix(pkg/rgbled): use action maps to turn on/off led colors
This commit is contained in:
@ -47,6 +47,7 @@ flucky rgb-led add my-led GPIO13 GPIO17 GPIO26`),
|
||||
RGBLEDName: args[0],
|
||||
RGBLEDLocation: location,
|
||||
RGBLEDEnabled: enabled,
|
||||
ActionMapping: types.DefaultActionMapping,
|
||||
BaseColorsToGPIO: map[types.BaseColor]*types.GPIO{
|
||||
types.BaseColorBlue: &gpioBlue,
|
||||
types.BaseColorGreen: &gpioGreen,
|
||||
|
@ -32,7 +32,7 @@ flucky rgb-led on 1c5b9424-f6e9-4a37-be5c-77e531e94aab red`,
|
||||
rgbLEDs = cnf.GetRGBLEDs(config.ENABLED)
|
||||
}
|
||||
|
||||
color, err := types.StrintToLEDColor(args[len(args)-1])
|
||||
color, err := types.StringToLEDColor(args[len(args)-1])
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user