helpers

package
v0.0.0-...-9c93832 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Home        = "Home"
	Rewind      = "Rev"
	Forward     = "Fwd"
	Play        = "Play"
	Pause       = "Play"
	Select      = "Select"
	Left        = "Left"
	Right       = "Right"
	Down        = "Down"
	Up          = "Up"
	Back        = "Back"
	Replay      = "InstantReplay"
	Star        = "Info"
	Backspace   = "Backspace"
	Search      = "Search"
	Enter       = "Enter"
	FindRemote  = "FindRemote"
	VolumeDown  = "VolumeDown"
	Mute        = "VolumeMute"
	VolumeUp    = "VolumeUp"
	PowerOn     = "PowerOn"
	Standby     = "PowerOff"
	ChannelUp   = "ChannelUp"
	ChannelDown = "ChannelDown"
	Tuner       = "InputTuner"
	HDMI1       = "InputHDMI1"
	HDMI2       = "InputHDMI2"
	HDMI3       = "InputHDMI3"
	HDMI4       = "InputHDMI4"
	Component   = "InputAV1"
)

A list of key values

View Source
const (
	DeviceInfo   = "device-info"
	AllApps      = "apps"
	CurrentInput = "active-app"
)

A list of query values

View Source
const (
	TVInput      = "tvin"
	Application  = "appl"
	Menu         = "menu"
	NDKA         = "ndka"
	RSGA         = "rsga"
	InputWhenOff = "Davinci Channel"
)

A list of Roku specific terms

Variables

View Source
var InputMap = map[string]string{
	"hdmi1":      HDMI1,
	"hdmi2":      HDMI2,
	"hdmi3":      HDMI3,
	"hdmi4":      HDMI4,
	"av":         Component,
	"tuner":      Tuner,
	InputWhenOff: "blanked",
}

InputMap is a mapping of input names

View Source
var PowerStateMap = map[string]string{
	"PowerOn":  "on",
	"Headless": "standby",
}

PowerStateMap maps their power state names to the ones used by this API

Functions

func GetCurrentInput

func GetCurrentInput(address string) (status.Input, *nerr.E)

GetCurrentInput returns the active input information

func GetHardwareInfo

func GetHardwareInfo(address string) (structs.HardwareInfo, *nerr.E)

GetHardwareInfo takes all the device info and packages it into the HardwareInfo struct format

func GetInputList

func GetInputList(address string) ([]string, *nerr.E)

GetInputList returns the list off all possible inputs and/or applications

func SendKeyDownRequest

func SendKeyDownRequest(address, key string) *nerr.E

SendKeyDownRequest sends a command to push a key down

func SendKeyPressRequest

func SendKeyPressRequest(address, key string) *nerr.E

SendKeyPressRequest sends a command to press a key

func SendKeyUpRequest

func SendKeyUpRequest(address, key string) *nerr.E

SendKeyUpRequest sends a command to "release" a key down

Types

type RokuActiveApp

type RokuActiveApp struct {
	XMLName xml.Name `xml:"active-app"`
	Text    string   `xml:",chardata"`
	App     RokuApp  `xml:"app"`
}

RokuActiveApp is a representation of the information presented to show the current active app/input

type RokuApp

type RokuApp struct {
	Text    string `xml:",chardata"`
	ID      string `xml:"id,attr"`
	Subtype string `xml:"subtype,attr"`
	Type    string `xml:"type,attr"`
	Version string `xml:"version,attr"`
}

RokuApp is the representation for one single app/input port

type RokuAppList

type RokuAppList struct {
	XMLName xml.Name  `xml:"apps"`
	Text    string    `xml:",chardata"`
	Apps    []RokuApp `xml:"app"`
}

RokuAppList is a representation of how the Roku lists its possible apps

type RokuDeviceResponse

type RokuDeviceResponse struct {
	XMLName                     xml.Name `xml:"device-info"`
	UDN                         string   `xml:"udn"`
	SerialNumber                string   `xml:"serial-number"`
	DeviceID                    string   `xml:"device-id"`
	AdvertisingID               string   `xml:"advertising-id"`
	VendorName                  string   `xml:"vendor-name"`
	ModelName                   string   `xml:"model-name"`
	ModelNumber                 string   `xml:"model-number"`
	ModelRegion                 string   `xml:"model-region"`
	IsTV                        bool     `xml:"is-tv"`
	IsStick                     bool     `xml:"is-stick"`
	ScreenSize                  int      `xml:"screen-size"`
	PanelID                     int      `xml:"panel-id"`
	TunerType                   string   `xml:"tuner-type"`
	SupportsEthernet            bool     `xml:"supports-ethernet"`
	WiFiMAC                     string   `xml:"wifi-mac"`
	WiFiDriver                  string   `xml:"wifi-driver"`
	EthernetMAC                 string   `xml:"ethernet-mac"`
	NetworkType                 string   `xml:"network-type"`
	NetworkName                 string   `xml:"network-name"`
	FriendlyDeviceName          string   `xml:"friendly-device-name"`
	FriendlyModelName           string   `xml:"friendly-model-name"`
	DefaultDeviceName           string   `xml:"default-device-name"`
	UserDeviceName              string   `xml:"user-device-name"`
	SoftwareVersion             string   `xml:"software-version"`
	SoftwareBuild               string   `xml:"software-build"`
	SecureDevice                bool     `xml:"secure-device"`
	Language                    string   `xml:"language"`
	Country                     string   `xml:"country"`
	Locale                      string   `xml:"locale"`
	TimeZoneAuto                bool     `xml:"time-zone-auto"`
	TimeZone                    string   `xml:"time-zone"`
	TimeZoneName                string   `xml:"time-zone-name"`
	TimeZoneTZ                  string   `xml:"time-zone-tz"`
	TimeZoneOffset              int      `xml:"time-zone-offset"`
	ClockFormat                 string   `xml:"clock-format"`
	Uptime                      int      `xml:"uptime"`
	PowerMode                   string   `xml:"power-mode"`
	SupportsSuspend             bool     `xml:"supports-suspend"`
	SupportsFindRemote          bool     `xml:"supports-find-remote"`
	SupportsAudioGuide          bool     `xml:"supports-audio-guide"`
	SupportsRVA                 bool     `xml:"supports-rva"`
	DeveloperEnabled            bool     `xml:"developer-enabled"`
	KeyedDeveloperID            string   `xml:"keyed-developer-id"`
	SearchEnabled               bool     `xml:"search-enabled"`
	SearchChannelsEnabled       bool     `xml:"search-channels-enabled"`
	VoiceSearchEnabled          bool     `xml:"voice-search-enabled"`
	NotificationsEnabled        bool     `xml:"notifications-enabled"`
	NotificationsFirstUse       bool     `xml:"notifications-first-use"`
	SupportsPrivateListening    bool     `xml:"supports-private-listening"`
	SupportsPrivateListeningDTV bool     `xml:"supports-private-listening-dtv"`
	SupportsWarmStandby         bool     `xml:"supports-warm-standby"`
	HeadphonesConnected         bool     `xml:"headphones-connected"`
	ExpertPQEnabled             string   `xml:"expert-pq-enabled"`
	SupportsECSTextEdit         bool     `xml:"supports-ecs-textedit"`
	SupportsECSMicrophone       bool     `xml:"supports-ecs-microphone"`
	SupportsWakeOnWLAN          bool     `xml:"supports-wake-on-wlan"`
	HasPlayOnRoku               bool     `xml:"has-play-on-roku"`
	HasMobileScreensaver        bool     `xml:"has-mobile-screensaver"`
	SupportURL                  string   `xml:"support-url"`
}

RokuDeviceResponse is the struct that the Roku device sends back when asking for device info

func GetDeviceInfo

func GetDeviceInfo(address string) (RokuDeviceResponse, *nerr.E)

GetDeviceInfo returns the device information

Jump to

Keyboard shortcuts

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