command

package
v0.0.0-...-bc49051 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFlags = []cli.Flag{
	&cli.StringFlag{
		Name:    flagConfig,
		Usage:   "The json config file path",
		Value:   os.ExpandEnv("${HOME}/.config/huectl/config.json"),
		EnvVars: []string{"HUE_CONFIG"},
	},
	&cli.StringFlag{
		Name:    flagUsername,
		Usage:   "The hue username to authenticate with",
		EnvVars: []string{"HUE_USERNAME"},
	},
	&cli.StringFlag{
		Name:    flagAddr,
		Usage:   "The hue bridge local address",
		EnvVars: []string{"HUE_ADDR"},
	},
	&cli.BoolFlag{
		Name:    flagQuiet,
		Aliases: []string{"q"},
		Usage:   "If command output should be suppressed",
	},
	&cli.BoolFlag{
		Name:    flagVerbose,
		Aliases: []string{"v"},
		Usage:   "If verbose command should be shown",
	},
}

DefaultFlags are the default (or persistent) flags.

View Source
var GroupFlags = []cli.Flag{
	&cli.IntFlag{
		Name:    flagGroupID,
		Aliases: []string{"id"},
		Usage:   "The group `ID` field of the group in question, exclusive with --group-name",
	},
	&cli.StringFlag{
		Name:    flagGroupName,
		Aliases: []string{"n", "name"},
		Usage:   "The group `Name` field of the group in question, exclusive with --group-id",
	},
}

GroupFlags are group related flags.

View Source
var Huectl = &cli.App{
	Name:  "huectl",
	Usage: "Control hue lights and scenes using a local bridge.",
	Flags: DefaultFlags,
	Action: func(c *cli.Context) error {
		cli.ShowAppHelp(c)
		return nil
	},
	Commands: []*cli.Command{
		Auth(),
		Script(),
		Pause(),

		ListLights(),
		ListGroups(),
		ListScenes(),
		SetGroupOn(),
		SetGroupOff(),
		SetGroupColor(),
		SetGroupScene(),
		SetGroupBrightness(),
		SetLightOn(),
		SetLightOff(),
		SetLightColor(),
		SetLightBrightness(),
	},
}

Huectl is the cli app.

View Source
var LightFlags = []cli.Flag{
	&cli.IntFlag{
		Name:    flagLightID,
		Aliases: []string{"id"},
		Usage:   "The `ID` field of the light in question",
	},
	&cli.StringFlag{
		Name:    flagLightName,
		Aliases: []string{"name", "n"},
		Usage:   "The `Name` field of the light in question",
	},
}

LightFlags are light related flags.

View Source
var OutputFlags = []cli.Flag{
	&cli.StringFlag{
		Name:    flagOutput,
		Aliases: []string{"o"},
		Usage:   "The output format (json|table|template)",
		EnvVars: []string{"HUE_OUTPUT"},
	},
	&cli.StringFlag{
		Name:    flagTemplate,
		Aliases: []string{"t"},
		Usage:   "The output template",
		EnvVars: []string{"HUE_OUTPUT_TEMPLATE"},
	},
}

OutputFlags are common output related flags.

Functions

func Auth

func Auth() *cli.Command

Auth returns the auth command.

func ListGroups

func ListGroups() *cli.Command

ListGroups returns a command.

func ListLights

func ListLights() *cli.Command

ListLights returns a command.

func ListScenes

func ListScenes() *cli.Command

ListScenes returns a command.

func Pause

func Pause() *cli.Command

Pause returns a command.

func Script

func Script() *cli.Command

Script returns a command.

func SetGroupBrightness

func SetGroupBrightness() *cli.Command

SetGroupBrightness returns a command.

func SetGroupColor

func SetGroupColor() *cli.Command

SetGroupColor returns a command.

func SetGroupOff

func SetGroupOff() *cli.Command

SetGroupOff returns a command.

func SetGroupOn

func SetGroupOn() *cli.Command

SetGroupOn returns a command.

func SetGroupScene

func SetGroupScene() *cli.Command

SetGroupScene returns a command.

func SetLightBrightness

func SetLightBrightness() *cli.Command

SetLightBrightness returns a command.

func SetLightColor

func SetLightColor() *cli.Command

SetLightColor returns a command.

func SetLightOff

func SetLightOff() *cli.Command

SetLightOff returns a command.

func SetLightOn

func SetLightOn() *cli.Command

SetLightOn returns a command.

Types

type ScriptAction

type ScriptAction struct {
	Name  string            `json:"name"`
	Flags map[string]string `json:"flags"`
}

ScriptAction is a specific action in a script.

type ScriptContents

type ScriptContents []ScriptAction

ScriptContents is a list of script actions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL