go>> roku>> 返回
项目作者: linuxfreak003

项目描述 :
Roku ECP library written in Go
高级语言: Go
项目地址: git://github.com/linuxfreak003/roku.git
创建时间: 2020-08-17T16:45:35Z
项目社区:https://github.com/linuxfreak003/roku

开源协议:MIT License

下载


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

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

or use go mod

Example

  1. package main
  2. import (
  3. "github.com/linuxfreak003/roku"
  4. )
  5. func main() {
  6. devices, err := roku.FindRokuDevices()
  7. if err != nil {
  8. panic(err)
  9. }
  10. r, err := roku.NewRemote(devices[0].Addr)
  11. if err != nil {
  12. panic(err)
  13. }
  14. err = r.VolumeUp()
  15. if err != nil {
  16. panic(err)
  17. }
  18. if r.Device.PowerMode == "PowerOn" {
  19. // ignoring errors for brevity
  20. r.PowerOff()
  21. r.Refresh()
  22. }
  23. }

CLI

Installation

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

Usage

  1. roku -ip 192.168.1.51

You can also simply run

  1. roku

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