Documentation ¶
Index ¶
- Constants
- Variables
- func FilterDevicesByRole(deviceList []base.Device, roleID string) []base.Device
- func FindDevice(deviceList []base.Device, searchID string) base.Device
- type AudioList
- type BlankedDefault
- type InputDSP
- type InputDefault
- type InputTieredSwitcher
- type InputVideoSwitcher
- type MutedDSP
- type MutedDefault
- type PowerDefault
- type Status
- type StatusCommand
- type StatusEvaluator
- type StatusResponse
- type TieredSwitcherCallback
- func (p *TieredSwitcherCallback) AddEdge(device base.Device, port string)
- func (p *TieredSwitcherCallback) Callback(sp base.StatusPackage, c chan<- base.StatusPackage) error
- func (p *TieredSwitcherCallback) GetInputPaths(pathfinder pathfinder.SignalPathfinder)
- func (p *TieredSwitcherCallback) StartAggregator()
- type VideoList
- type VolumeDSP
- type VolumeDefault
Constants ¶
const BlankedDefaultCommand = "STATUS_Blanked"
BlankedDefaultCommand is a constant variable for the name of the command.
const BlankedDefaultEvaluator = "STATUS_BlankedDefault"
BlankedDefaultEvaluator is a constant variable for the name of the evaluator.
const DefaultInputCommand = "STATUS_Input"
DefaultInputCommand is a constant variable for the name of the command.
const DefaultInputEvaluator = "STATUS_InputDefault"
DefaultInputEvaluator is a constant variable for the name of the evaluator.
const FLAG = "STATUS"
FLAG is a constant variable...
const InputDSPCommand = "STATUS_Input"
InputDSPCommand is a constant variable for the name of the command.
const InputDSPEvaluator = "STATUS_InputDSP"
InputDSPEvaluator is a constant variable for the name of the evaluator.
const InputTieredSwitcherEvaluator = "STATUS_Tiered_Switching"
InputTieredSwitcherEvaluator is a constant variable for the name of the evaluator.
const InputVideoSwitcherEvaluator = "STATUS_InputVideoSwitcher"
InputVideoSwitcherEvaluator is a constant variable for the name of the evaluator.
const MutedDSPCommand = "STATUS_MutedDSP"
MutedDSPCommand is a constant variable for the name of the command.
const MutedDSPEvaluator = "STATUS_MutedDSP"
MutedDSPEvaluator is a constant variable for the name of the evaluator.
const MutedDefaultCommand = "STATUS_Muted"
MutedDefaultCommand is a constant variable for the name of the command.
const MutedDefaultEvaluator = "STATUS_MutedDefault"
MutedDefaultEvaluator is a constant variable for the name of the evaluator.
const PowerDefaultCommand = "STATUS_Power"
PowerDefaultCommand is a constant variable for the name of the command.
const PowerDefaultEvaluator = "STATUS_PowerDefault"
PowerDefaultEvaluator is a constant variable for the name of the evaluator.
const VolumeDSPCommand = "STATUS_VolumeDSP"
VolumeDSPCommand is a constant variable for the name of the command.
const VolumeDSPEvaluator = "STATUS_VolumeDSP"
VolumeDSPEvaluator is a constant variable for the name of the evaluator.
const VolumeDefaultCommand = "STATUS_Volume"
VolumeDefaultCommand is a constant variable for the name of the command.
const VolumeDefaultEvaluator = "STATUS_VolumeDefault"
VolumeDefaultEvaluator is a constant variable for the name of the evaluator.
Variables ¶
var StatusEvaluatorMap = map[string]StatusEvaluator{ "STATUS_PowerDefault": &PowerDefault{}, "STATUS_BlankedDefault": &BlankedDefault{}, "STATUS_MutedDefault": &MutedDefault{}, "STATUS_InputDefault": &InputDefault{}, "STATUS_VolumeDefault": &VolumeDefault{}, "STATUS_InputVideoSwitcher": &InputVideoSwitcher{}, "STATUS_InputDSP": &InputDSP{}, "STATUS_MutedDSP": &MutedDSP{}, "STATUS_VolumeDSP": &VolumeDSP{}, "STATUS_Tiered_Switching": &InputTieredSwitcher{}, }
StatusEvaluatorMap is a map of the different StatusEvaluators used. TODO: we shoud grab the keys from constants in the evaluators themselves
Functions ¶
func FilterDevicesByRole ¶
FilterDevicesByRole searches a list of devices for the devices that have the given roles, and returns a new list of those devices
Types ¶
type BlankedDefault ¶
type BlankedDefault struct { }
BlankedDefault implements the StatusEvaluator struct.
func (*BlankedDefault) EvaluateResponse ¶
func (p *BlankedDefault) EvaluateResponse(room base.Room, label string, value interface{}, Source base.Device, dest base.DestinationDevice) (string, interface{}, error)
EvaluateResponse is supposed to evaluate the response...but it seems like it's just logging a statement...
func (*BlankedDefault) GenerateCommands ¶
func (p *BlankedDefault) GenerateCommands(room base.Room) ([]StatusCommand, int, error)
GenerateCommands generates a list of commands for the given devices.
type InputDSP ¶
type InputDSP struct{}
InputDSP implements the StatusEvaluator struct.
func (*InputDSP) EvaluateResponse ¶
func (p *InputDSP) EvaluateResponse(room base.Room, label string, value interface{}, source base.Device, DestinationDevice base.DestinationDevice) (string, interface{}, error)
EvaluateResponse processes the response information that is given.
func (*InputDSP) GenerateCommands ¶
GenerateCommands generates a list of commands for the given devices.
type InputDefault ¶
type InputDefault struct { }
InputDefault implements the StatusEvaluator struct.
func (*InputDefault) EvaluateResponse ¶
func (p *InputDefault) EvaluateResponse(room base.Room, label string, value interface{}, source base.Device, dest base.DestinationDevice) (string, interface{}, error)
EvaluateResponse processes the response information that is given.
func (*InputDefault) GenerateCommands ¶
func (p *InputDefault) GenerateCommands(room base.Room) ([]StatusCommand, int, error)
GenerateCommands generates a list of commands for the given devices.
type InputTieredSwitcher ¶
type InputTieredSwitcher struct { }
InputTieredSwitcher implements the StatusEvaluator struct.
func (*InputTieredSwitcher) EvaluateResponse ¶
func (p *InputTieredSwitcher) EvaluateResponse(room base.Room, str string, face interface{}, dev base.Device, destDev base.DestinationDevice) (string, interface{}, error)
EvaluateResponse processes the response information that is given.
func (*InputTieredSwitcher) GenerateCommands ¶
func (p *InputTieredSwitcher) GenerateCommands(room base.Room) ([]StatusCommand, int, error)
GenerateCommands generates a list of commands for the given devices.
type InputVideoSwitcher ¶
type InputVideoSwitcher struct { }
InputVideoSwitcher implements the StatusEvaluator struct.
func (*InputVideoSwitcher) EvaluateResponse ¶
func (p *InputVideoSwitcher) EvaluateResponse(room base.Room, label string, value interface{}, source base.Device, dest base.DestinationDevice) (string, interface{}, error)
EvaluateResponse processes the response information that is given.
func (*InputVideoSwitcher) GenerateCommands ¶
func (p *InputVideoSwitcher) GenerateCommands(room base.Room) ([]StatusCommand, int, error)
GenerateCommands generates a list of commands for the given devices.
type MutedDSP ¶
type MutedDSP struct{}
MutedDSP implements the StatusEvaluator struct.
func (*MutedDSP) EvaluateResponse ¶
func (p *MutedDSP) EvaluateResponse(room base.Room, label string, value interface{}, source base.Device, destintation base.DestinationDevice) (string, interface{}, error)
EvaluateResponse processes the response information that is given.
func (*MutedDSP) GenerateCommands ¶
GenerateCommands generates a list of commands for the given devices.
type MutedDefault ¶
type MutedDefault struct { }
MutedDefault implements the StatusEvaluator struct.
func (*MutedDefault) EvaluateResponse ¶
func (p *MutedDefault) EvaluateResponse(room base.Room, label string, value interface{}, Source base.Device, dest base.DestinationDevice) (string, interface{}, error)
EvaluateResponse processes the response information that is given.
func (*MutedDefault) GenerateCommands ¶
func (p *MutedDefault) GenerateCommands(room base.Room) ([]StatusCommand, int, error)
GenerateCommands generates a list of commands for the given devices.
type PowerDefault ¶
type PowerDefault struct { }
PowerDefault implements the StatusEvaluator struct.
func (*PowerDefault) EvaluateResponse ¶
func (p *PowerDefault) EvaluateResponse(room base.Room, label string, value interface{}, Source base.Device, dest base.DestinationDevice) (string, interface{}, error)
EvaluateResponse processes the response information that is given
func (*PowerDefault) GenerateCommands ¶
func (p *PowerDefault) GenerateCommands(room base.Room) ([]StatusCommand, int, error)
GenerateCommands generates a list of commands for the given devices.
type Status ¶
type Status struct { Status map[string]interface{} `json:"status"` DestinationDevice base.DestinationDevice `json:"destination_device"` }
Status represents output from a device, use Error field to flag errors
type StatusCommand ¶
type StatusCommand struct { ActionID string `json:"action_id"` Action base.Command `json:"action"` Device base.Device `json:"device"` Callback func(base.StatusPackage, chan<- base.StatusPackage) error Generator string `json:"generator"` DestinationDevice base.DestinationDevice `json:"destination"` Parameters map[string]string `json:"parameters"` }
StatusCommand contains information to issue a status command against a device
type StatusEvaluator ¶
type StatusEvaluator interface { //Generates action list GenerateCommands(room base.Room) ([]StatusCommand, int, error) //Evaluate Response EvaluateResponse(room base.Room, label string, value interface{}, Source base.Device, Destination base.DestinationDevice) (string, interface{}, error) }
StatusEvaluator defines the common functions for all StatusEvaluators.
type StatusResponse ¶
type StatusResponse struct { SourceDevice base.Device `json:"source_device"` DestinationDevice base.DestinationDevice `json:"destination_device"` Callback func(base.StatusPackage, chan<- base.StatusPackage) error Generator string `json:"generator"` Status map[string]interface{} `json:"status"` ErrorMessage *string `json:"error"` }
StatusResponse represents a status response, including the generator that created the command that returned the status
type TieredSwitcherCallback ¶
type TieredSwitcherCallback struct { InChan chan base.StatusPackage OutChan chan<- base.StatusPackage Devices []base.Device ExpectedCount int ExpectedActionCount int // contains filtered or unexported fields }
TieredSwitcherCallback defines the callback information for the tiered switching commands and responses.
func (*TieredSwitcherCallback) AddEdge ¶
func (p *TieredSwitcherCallback) AddEdge(device base.Device, port string)
AddEdge initializes the pathfinder if it hasn't been, and then adds an edge. This should ONLY be used when there is only one port on the device.
func (*TieredSwitcherCallback) Callback ¶
func (p *TieredSwitcherCallback) Callback(sp base.StatusPackage, c chan<- base.StatusPackage) error
Callback begins the callback process...
func (*TieredSwitcherCallback) GetInputPaths ¶
func (p *TieredSwitcherCallback) GetInputPaths(pathfinder pathfinder.SignalPathfinder)
GetInputPaths generates a directed graph of the tiered switching layout.
func (*TieredSwitcherCallback) StartAggregator ¶
func (p *TieredSwitcherCallback) StartAggregator()
StartAggregator starts the aggregator...I guess haha...
type VolumeDSP ¶
type VolumeDSP struct{}
VolumeDSP implements the StatusEvaluator struct.
func (*VolumeDSP) EvaluateResponse ¶
func (p *VolumeDSP) EvaluateResponse(room base.Room, label string, value interface{}, source base.Device, destination base.DestinationDevice) (string, interface{}, error)
EvaluateResponse processes the response information that is given.
func (*VolumeDSP) GenerateCommands ¶
GenerateCommands generates a list of commands for the given devices.
type VolumeDefault ¶
type VolumeDefault struct { }
VolumeDefault implements the StatusEvaluator struct.
func (*VolumeDefault) EvaluateResponse ¶
func (p *VolumeDefault) EvaluateResponse(room base.Room, label string, value interface{}, Source base.Device, dest base.DestinationDevice) (string, interface{}, error)
EvaluateResponse processes the response information that is given.
func (*VolumeDefault) GenerateCommands ¶
func (p *VolumeDefault) GenerateCommands(room base.Room) ([]StatusCommand, int, error)
GenerateCommands generates a list of commands for the given devices.