samtv

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 17 Imported by: 0

README

samtvcli

samtvcli is a network CLI remote for Samsung TVs from 2014-2015 (I think those are models H & J).

You can use it to send keys with the command line or use its basic text user interface in a console.

You can also use samtv as a Golang library and build your own application.

I have tested it with a Samsung UE48JU6000 TV.

godoc license

Installation

Download

Check the Release page for some pre-built binaries.

Building from source

To install the application from source, just type:

go get -u github.com/McKael/samtv/samtvcli

and you should be able to run samtvcli.

Alternatively, if you use Go v1.11+, you can use go module support:

git clone https://github.com/McKael/samtv
cd samtv/samtvcli
go build

Usage

Get online help with samtvcli help.

Instead of providing IP and session information on the command line for each invocation, you can create a YAML configuration file (expected by default at $HOME/.config/samtvcli/keybindings.yaml). There is a sample configuration file in the repository.

To pair the application with the television, run

% samtvcli pair             # This should display the PIN page on TV
% samtvcli pair --pin CODE

Once paired, a basic text user interface can be used:

% samtvcli tui

Screenshot

The text user interface keybindings can be customized with a YAML configuration file.

You can also use the command line and send several keys at once:

% samtvcli key send KEY_MENU _ KEY_RETURN KEY_VOLUP

Use the help command (or the generated manpages for details).

Free free to send me a message if you like the software!

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SamsungKeyList = []string{}/* 244 elements not displayed */

SamsungKeyList is a list of known Samsung key identifiers

Functions

func GetKeyCodeList

func GetKeyCodeList() (list []string)

GetKeyCodeList returns a list of key codes

Types

type SmartDeviceDescription

type SmartDeviceDescription struct {
	DUID              string
	Model             string
	ModelName         string
	ModelDescription  string
	NetworkType       string
	SSID              string
	IP                string
	FirmwareVersion   string
	DeviceName        string
	DeviceID          string
	UDN               string
	Resolution        string
	CountryCode       string
	SmartHubAgreement string
	ServiceURI        string
	DialURI           string
	Capabilities      []struct {
		Name     string
		Port     string
		Location string
	}
}

SmartDeviceDescription contains a TV device description

type SmartViewSession

type SmartViewSession struct {
	// contains filtered or unexported fields
}

SmartViewSession contains data for a Smart View session

func NewSmartViewSession

func NewSmartViewSession(tvAddress string) (*SmartViewSession, error)

NewSmartViewSession initializes en new SmartViewSession

func (*SmartViewSession) Close

func (s *SmartViewSession) Close()

Close terminates the websocket connection

func (*SmartViewSession) DeviceDescription

func (s *SmartViewSession) DeviceDescription() (SmartDeviceDescription, error)

DeviceDescription fetches the description from the TV device

func (*SmartViewSession) GetMessage

func (s *SmartViewSession) GetMessage(block bool) string

GetMessage returns the next message received from the device If block is true, the read will block for 5 seconds.

func (*SmartViewSession) InitSession

func (s *SmartViewSession) InitSession() error

InitSession initiates a websocket connection for the SmartViewSession

func (*SmartViewSession) Key

func (s *SmartViewSession) Key(key string) error

Key sends a key to the TV device

func (*SmartViewSession) Pair

func (s *SmartViewSession) Pair(pin int) (string, int, string, error)

Pair handles pairing with the TV device If the pin is 0, the PIN popup is requested. It returns (deviceid, sessionid, key, error).

func (*SmartViewSession) RestoreSessionData

func (s *SmartViewSession) RestoreSessionData(sessionKey []byte, sessionID int, uuid string)

RestoreSessionData sets SmartViewSession key, ID and UUID values

Directories

Path Synopsis
doc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL