1.2.2 • Published 3 years ago

lg-netcast v1.2.2

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

lg-netcast

Netcast client written in js/ts

Installation

npm install lg-netcast

Usage Example

Initialize the client with the API host. By default the port is :8080, make sure you add that to your API_HOST

Get current channel information

const client = new NetcastClient(API_HOST);
client.get_session(access_token).then(async (session_id) => {
    const cur_channel = await client.get_current_channel(session_id);
    console.log(cur_channel);
});

Check the API docs for general usage on this package

Authentication

To interact with the TV, you need a valid access_token. The access token is actually just the pair code of the TV, you can get that with client.display_pair_code().

CLI

This package comes with a very simple CLI to query TV information

Usage: netcast-cli [options]

Options:
  --host: Host of the TV
    (default: "192.168.1.1:8080")
  --access_token: Pair code of the TV
    (default: "123456")
    (an integer)
  --command: command to issue
    (default: "current_channel")
❯ netcast-cli --host 192.168.1.14:8080 --access_token 1234567
Querying current channel
{
  chtype: 'satellite',
  sourceIndex: '7',
  physicalNum: '265',
  major: '200',
  displayMajor: '200',
  minor: '65535',
  displayMinor: '-1',
  chname: 'スターチャンネル1',
  progName: 'エスケープ・ルーム(2019)',
  audioCh: '0',
  inputSourceName: 'TV',
  inputSourceType: '0',
  labelName: {},
  inputSourceIdx: '0'
}

License

MIT

1.2.2

3 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago