Skip to content

mh-orange/hdhomerun

Repository files navigation

hdhomerun

Build Status GoDoc Coverage Status

======

Overview

Use this package to connect to and interact with HD HomeRun devices.

Installation

go get github.com/mh-orange/hdhomerun

Examples

Discover devices:
package main

import(
  "fmt"
  "github.com/mh-orange/hdhomerun"
)

func main() {
  for discoverResult := range hdhomerun.Discover(nil, time.Millisecond*200) {
    if discoverResult.Err != nil {
      fmt.Printf("Error during discovery: %v\n", discoverResult.Err)
    } else {
      fmt.Printf("hdhomerun device %s found at %s\n", discoverResult.Device.ID(), discoverResult.Device.Addr())
    }
  }
}
Tune to a channel:
package main

import(
  "github.com/mh-orange/hdhomerun"
  "net"
)

func main() {
  device, _ := hdhomerun.ConnectTCP(&net.TCPAddr{net.IP{192,168,1,100}, 65001, ""})
  tuner := device.Tuner(0)
  tuner.Tune("auto", 177000000)
}
Scan available channels:
package main

import(
  "fmt"
  "github.com/mh-orange/hdhomerun"
  "net"
)

func main() {
  device, _ := hdhomerun.ConnectTCP(&net.TCPAddr{net.IP{192,168,1,100}, 65001, ""})
  tuner := device.Tuner(0)
  for result := range tuner.Scan() {
    if result.Err != nil {
      fmt.Printf("Error scanning for channels: %v\n", err)
      continue
    }
    fmt.Printf("Found channel %s\n", result.Channel.Name)
  }
}

About

HD Homerun Config library for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages