chbmuc / cec

cec.go - a golang binding for libcec
MIT License
40 stars 21 forks source link

cec.go - a golang binding for libcec

cec.go is a Go interface to LibCEC.

Install

Make sure you have libcec and it's header files installed (apt-get install libcec-dev)

go get github.com/chbmuc/cec

Getting Started

A simple example to turn on the TV:

package main

import (
    "fmt"
    "github.com/chbmuc/cec"
)

func main() {
    c, err := cec.Open("", "cec.go", true)
    if err != nil {
        fmt.Println(err)
    }
    c.PowerOn(0)
}