Skip to content

linuxfreak003/roku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

roku

Documentation

Roku ECP library written in Go

Inspired by https://github.com/ncmiller/roku-cli

The project started out aiming to essentially be a GoLang fork of roku-cli, adding in the options of VolumeUp and VolumeDown buttons.

It is now turning into a Roku ECP library, with accompanying CLI Roku Remote

Library

Installation

go get -u github.com/linuxfreak003/roku

or use go mod

Example

package main

import (
  "github.com/linuxfreak003/roku"
)

func main() {
  devices, err := roku.FindRokuDevices()
  if err != nil {
    panic(err)
  }
  r, err := roku.NewRemote(devices[0].Addr)
  if err != nil {
    panic(err)
  }
  err = r.VolumeUp()
  if err != nil {
    panic(err)
  }
  if r.Device.PowerMode == "PowerOn" {
    // ignoring errors for brevity
    r.PowerOff()
    r.Refresh()
  }
}

CLI

Installation

go get -u github.com/linuxfreak003/roku/roku

Usage

roku -ip 192.168.1.51

You can also simply run

roku

and it will search for Roku devices on the network (takes an extra 3 seconds).