package main import ( "fmt" "os" "github.com/spf13/cobra" ) func NewDisableCmd() *cobra.Command { return &cobra.Command{ Use: "disable", Short: "Disable RGB lighting", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { zones, err := selectedZones() if err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) os.Exit(1) } proto, err := OpenDevice() if err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) os.Exit(1) } defer proto.Close() if err := disableLightingOnZones(proto, zones); err != nil { fmt.Fprintf(os.Stderr, "Error disabling RGB: %v\n", err) os.Exit(1) } fmt.Println("RGB disabled") }, } }