crestroncontrol

package
v0.0.0-...-f5dc2ee Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SignalConfigFile map[string]SignalConfig

SignalConfigFile maps signal names to their operations.

Functions

func ParseConfig

func ParseConfig() (map[string]SignalConfig, error)

ParseConfig gets the config file and reads it into the struct

Types

type SignalConfig

type SignalConfig struct {
	SignalValueSequence []SignalValue `json:"signalValueSequence"`
}

SignalConfig represents the structure, along with SignalValue. JSON Format of the file is as follows:

{
    "PowerStandby": {
       "signalValueSequence": [{
			"signalName": "confirm_system_off",
			"isSignalUrlParameter": true,
			"value": "1",
			"isValueUrlParameter": false
        }, {
			"signalName": "confirm_system_off",
			"isSignalUrlParameter": true,
			"value": "1",
			"isValueUrlParameter": false
        }]
    },
    "ChangeInput": {
        "signalName": "port",
        "isUrlParameter": true,
        "signalValueSequence": [{
            "value": "1",
            "isUrlParameter": false
        }]
    },
    "SetVolume": {
        "signalName": "system_volume_level",
        "isUrlParameter": false,
        "signalValueSequence": [{
            "value": "level",
            "isUrlParameter": true
        }]
    }
}

type SignalState

type SignalState struct {
	SignalName string
	Value      string
}

SignalState represents a signal state.

func GetSignalConfigSequence

func GetSignalConfigSequence(context echo.Context, command string) ([]SignalState, error)

GetSignalConfigSequence needs to handle if we need to paramterize the signal name, as well as the value. returns a map of signalName -> value

type SignalValue

type SignalValue struct {
	SignalName           string `json:"signalName"`
	IsSignalURLParameter bool   `json:"isSignalUrlParameter"`
	Value                string `json:"value"`
	IsValueURLParameter  bool   `json:"isValueUrlParameter"`
}

SignalValue is the single value to set a signal to.

Jump to

Keyboard shortcuts

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