statusevaluators

package
v0.0.0-...-75739c8 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const BlankedDefaultCommand = "STATUS_Blanked"

BlankedDefaultCommand is a constant variable for the name of the command.

View Source
const BlankedDefaultEvaluator = "STATUS_BlankedDefault"

BlankedDefaultEvaluator is a constant variable for the name of the evaluator.

View Source
const DefaultInputCommand = "STATUS_Input"

DefaultInputCommand is a constant variable for the name of the command.

View Source
const DefaultInputEvaluator = "STATUS_InputDefault"

DefaultInputEvaluator is a constant variable for the name of the evaluator.

View Source
const FLAG = "STATUS"

FLAG is a constant variable...

View Source
const InputDSPCommand = "STATUS_Input"

InputDSPCommand is a constant variable for the name of the command.

View Source
const InputDSPEvaluator = "STATUS_InputDSP"

InputDSPEvaluator is a constant variable for the name of the evaluator.

View Source
const InputTieredSwitcherEvaluator = "STATUS_Tiered_Switching"

InputTieredSwitcherEvaluator is a constant variable for the name of the evaluator.

View Source
const InputVideoSwitcherEvaluator = "STATUS_InputVideoSwitcher"

InputVideoSwitcherEvaluator is a constant variable for the name of the evaluator.

View Source
const MutedDSPCommand = "STATUS_MutedDSP"

MutedDSPCommand is a constant variable for the name of the command.

View Source
const MutedDSPEvaluator = "STATUS_MutedDSP"

MutedDSPEvaluator is a constant variable for the name of the evaluator.

View Source
const MutedDefaultCommand = "STATUS_Muted"

MutedDefaultCommand is a constant variable for the name of the command.

View Source
const MutedDefaultEvaluator = "STATUS_MutedDefault"

MutedDefaultEvaluator is a constant variable for the name of the evaluator.

View Source
const PowerDefaultCommand = "STATUS_Power"

PowerDefaultCommand is a constant variable for the name of the command.

View Source
const PowerDefaultEvaluator = "STATUS_PowerDefault"

PowerDefaultEvaluator is a constant variable for the name of the evaluator.

View Source
const VolumeDSPCommand = "STATUS_VolumeDSP"

VolumeDSPCommand is a constant variable for the name of the command.

View Source
const VolumeDSPEvaluator = "STATUS_VolumeDSP"

VolumeDSPEvaluator is a constant variable for the name of the evaluator.

View Source
const VolumeDefaultCommand = "STATUS_Volume"

VolumeDefaultCommand is a constant variable for the name of the command.

View Source
const VolumeDefaultEvaluator = "STATUS_VolumeDefault"

VolumeDefaultEvaluator is a constant variable for the name of the evaluator.

Variables

View Source
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

func FilterDevicesByRole(deviceList []base.Device, roleID string) []base.Device

FilterDevicesByRole searches a list of devices for the devices that have the given roles, and returns a new list of those devices

func FindDevice

func FindDevice(deviceList []base.Device, searchID string) base.Device

FindDevice searches a list of devices for the device specified by the given ID and returns it

Types

type AudioList

type AudioList struct {
	Inputs []status.Input `json:"inputs"`
}

AudioList is a base evaluator struct.

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

func (p *InputDSP) GenerateCommands(room base.Room) ([]StatusCommand, int, error)

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

func (p *MutedDSP) GenerateCommands(room base.Room) ([]StatusCommand, int, error)

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

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 VideoList

type VideoList struct {
	Inputs []status.Input `json:"inputs"`
}

VideoList is a base evaluator struct.

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

func (p *VolumeDSP) GenerateCommands(room base.Room) ([]StatusCommand, int, error)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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