package main import ( "fmt" "github.com/spf13/cobra" ) func NewDisableCmd() *cobra.Command { return withZoneArgs(&cobra.Command{ Use: "disable ", Short: "Disable RGB lighting on a zone", Long: writesLighting("Turn the lighting off on the named channels, by writing brightness 0."), RunE: func(cmd *cobra.Command, args []string) error { proto, _, channels, err := openTarget(args[0]) if err != nil { return err } defer proto.Close() if err := disableLightingOnChannels(proto, channels); err != nil { return fmt.Errorf("disable RGB: %w", err) } fmt.Fprintln(cmd.OutOrStdout(), "RGB disabled") return nil }, }, 1, 1, "a zone") }