Skip to content

Command Structure

Logan Savage edited this page May 27, 2026 · 3 revisions

Command Structure

This library is designed around a builder syntax, with two sections:

  1. Filters, which sequentially filter down the devices shown
  2. Actions, which are a sequence of actions to perform on the devices that pass through every filter

With this, the structure of a command is:

err := controller.Devices().
  <filterFunctions>.
  <actionFunctions>.
  Exec()

Example

err = controller.Devices().
	TypeIs(veego.DeviceLight).   // Filter function
	NameMatches("^Living Room"). // Filter function
	Off().                       // Action function
	Exec()

Clone this wiki locally