Giter VIP home page Giter VIP logo

webostv's Introduction

webostv - Go package for controlling LG WebOS TV

GoDoc

This is Go library and a terminal application for remote control of LG WebOS smart televisions. Works on Linux and Windows and probably on OS X as well. It has been tested with LG 42LB650V-ZN television.

Installing and using the remote control application

Download pre-built executable binary for your OS/architecture from: https://github.com/snabb/webostv/releases

Run the downloaded application in a terminal window. On Linux, add execute permissions after downloading (chmod 755 webostvremote-linux-amd64). The IP address or name of the TV can be given as a command line argument:

./webostvremote 192.0.2.123

If the address is not supplied, it will try to connect to the default address LGsmartTV.lan.

Building the remote control application from source

Install Go compiler if you do not have it:

curl https://dl.google.com/go/go1.12.linux-amd64.tar.gz | sudo tar xzC /usr/local
PATH=$PATH:/usr/local/go/bin

(See https://golang.org/dl/ for newer version and more detailed instructions.)

Compile:

git clone https://github.com/snabb/webostv.git
cd webostv
go build ./cmd/webostvremote

The compiled binary webostvremote is produced in the current working directory. If there are errors, try again with up-to-date Go compiler version.

Simple example of using the library to turn off the TV

package main

import "github.com/snabb/webostv"

func main() {
	tv, err := webostv.DefaultDialer.Dial("LGsmartTV.lan")
	if err != nil {
		panic(err)
	}
	defer tv.Close()
	go tv.MessageHandler()

	_, err = tv.Register("")
	if err != nil {
		panic(err)
	}

	err = tv.SystemTurnOff()
	if err != nil {
		panic(err)
	}
}

Unimplemented / TODO

webostv library

  • Documentation.
  • Consider the method names, some could be shortened.
  • PIN based pairing.
  • UPnP discovery?
  • Add missing subscriptions?
  • Play media?

webostvremote application

  • Documentation.
  • Volume mute.
  • Make "store" a separate generic package (or find pre-existing one).
  • Make it look better.
    • Colors.
    • Clarify channel + program info etc.
  • Error popup?
  • Program guide.
  • TV mouse control.
  • TV keyboard input.
  • Play media?

License

MIT

webostv's People

Contributors

snabb avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.