fakepixelpusher

package
v0.0.0-...-8d9275d Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute runs the application.

Types

type Config

type Config struct {
	// Devices is a list of Devices to populate.
	Devices []*Device `yaml:"devices"`

	// DefaultDevice is a configured default device.
	DefaultDevice *Device `yaml:"default_device"`
}

Config is as top-level configuration file.

func LoadConfigYAML

func LoadConfigYAML(path string) (*Config, error)

LoadConfigYAML loads a Config from a YAML file.

type Device

type Device struct {
	// HardwareAddress is the hardware address, in text format.
	//
	// For example: 00:01:02:03:04:05
	HardwareAddress string `yaml:"hardware_address,omitempty"`

	// Group is the group ordinal value.
	Group int32 `yaml:"group,omitempty"`
	// Controller is the controller ordinal.
	Controller int32 `yaml:"controller,omitempty"`

	// Strips is the number of strips.
	Strips uint8 `yaml:"strips,omitempty"`
	// Pixels is the number of pixels per strip.
	Pixels uint16 `yaml:"pixels,omitempty"`
}

Device is a configuration for a single device.

func (*Device) BuildHeaders

func (d *Device) BuildHeaders(index int, cfg *Config) (*protocol.DiscoveryHeaders, error)

BuildHeaders builds DiscoveryHeaders for this Device.

If fields are missing, the values from def will be used. Generated fields that need to be unique will use index to differentiate themselves.

Jump to

Keyboard shortcuts

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