roku

package module
v1.0.0 Latest Latest
Warning

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

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

README

go-roku

Golang client library for controlling roku devices

Documentation

Overview

Package roku provides the ability to query and control roku devices on the network

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveAppInfo

type ActiveAppInfo struct {
	App AppInfo `xml:"app"`
}

ActiveAppInfo is a wrapper around a single application information structure

type AppInfo

type AppInfo struct {
	Id      string `xml:"id,attr"`
	Subtype string `xml:"subtype,attr"`
	Type    string `xml:"type,attr"`
	Version string `xml:"version,attr"`
	Name    string `xml:",chardata"`
}

AppInfo holds information about applications

type Device

type Device struct {
	URL string

	DeviceInformationProvider
	// contains filtered or unexported fields
}

Device is a structure which contains information about a roku device.

func ProcessDevices

func ProcessDevices(list []ssdp.Service, client *http.Client) []*Device

ProcessDevices takes a list of ssdp services and builds an array of Device objects.

func Scan

func Scan(timeout int) ([]*Device, error)

Scan uses ssdp to discover roku devices on the network

func (*Device) GetActiveApp

func (d *Device) GetActiveApp() (*ActiveAppInfo, error)

GetActiveApp retrieves information about the currently active app on a connected roku device

func (*Device) GetDeviceInformation

func (d *Device) GetDeviceInformation() (*DeviceInfo, error)

GetDeviceInformation retrieves information about a connected roku device.

func (*Device) GetInstalledApps

func (d *Device) GetInstalledApps() (*InstalledAppsList, error)

GetInstalledApps retrieves a list of the installed apps on a roku device.

type DeviceInfo

type DeviceInfo struct {
	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"`
	WifiMacAddress              string `xml:"wifi-mac"`
	WifiDriver                  string `xml:"wifi-driver"`
	EthernetMacAddress          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"`
	UserDeviceLocation          string `xml:"user-device-location"`
	BuildNumber                 string `xml:"build-number"`
	SoftwareVersion             string `xml:"software-version"`
	SoftwareBuild               int    `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"`
	FindRemoteIsPossible        bool   `xml:"find-remote-is-possible"`
	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"`
	GrandcentralVersion         string `xml:"grandcentral-version"`
	TrcVersion                  string `xml:"trc-version"`
	TrcChannelVersion           string `xml:"trc-channel-version"`
	HasWifiExtender             bool   `xml:"has-wifi-extender"`
	HasWifi5GSupport            bool   `xml:"has-wifi-5G-support"`
	CanUseWifiExtender          bool   `xml:"can-use-wifi-extender"`
}

DeviceInfo is a structure for holding information retrieved via roku ecp api.

type DeviceInformationProvider

type DeviceInformationProvider interface {
	GetDeviceInformation() (*DeviceInfo, error)
	GetActiveApp() (*ActiveAppInfo, error)
	GetInstalledApps() ([]*AppInfo, error)
}

DeviceInformationProvider contains the controls to query a roku device

type InstalledAppsList

type InstalledAppsList struct {
	Apps []AppInfo `xml:"app"`
}

InstalledAppsList holds information about all applications installed on a roku device

Jump to

Keyboard shortcuts

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