Client to interact with necast TVs host has to include a valid port number. By default LG TVs use 8080 so make sure to specify that eg. 192.168.1.3:8080
Following options are supported:
interface Options {
timeout: 2000;
}
Kind: global class
Creates a new NetcastClient instance
Param | Type | Description |
---|---|---|
host | string |
The host |
options | 2000 |
The options |
Wraps the given command into an XML block ready to send to the TV
Kind: instance method of NetcastClient
Param | Type | Default | Description |
---|---|---|---|
command_type | LG_HANDLE |
LG_HANDLE |
|
command | Channel |
either a LG_COMMAND or other payload, such as Channel |
|
session | string |
null |
the current session id. if not specified, the command will be unauthenticated |
Sends the given message to the TV. message has to be in XML format Will return a javascript object with the result, or throw an exception
Kind: instance method of NetcastClient
Param | Type | Default | Description |
---|---|---|---|
message_type | string |
Type of the message to send, eg 'data', 'command', 'auth' |
|
message | string |
null |
Message to send in XML string format |
payload | object |
|
Payload & (GET) parameters to send |
Issues a command to the TV to display the pair code // access token
Kind: instance method of NetcastClient
Retrieves (or creates) the current session used for interacting with the TV
Kind: instance method of NetcastClient
Param | Type | Default | Description |
---|---|---|---|
access_token | string |
null |
Access token aka pair code |
Issues a query command to the TV to retrieve current information such as channel, volume, etc
Kind: instance method of NetcastClient
Param | Type | Description |
---|---|---|
query | LG_QUERY |
What to query. See LG_QUERY type |
Sends the given command to the TV To issue commands, you need a valid
session id. To retrieve that, use get_session()
paired with the
access_token of the TV To get the access_token, use display_pair_code()
Kind: instance method of NetcastClient
Param | Type | Description |
---|---|---|
command | LG_COMMAND |
The command to send, see LG_COMMAND type |
session | string |
Session id |
Changes channel to the given channel
Kind: instance method of NetcastClient
Param | Type | Description |
---|---|---|
channel | Channel |
The channel to switch to. Has to be in a specific format, see Channel type |
session | string |
Session id |
Retrieves the current channel information from the TV
Kind: instance method of NetcastClient
Param | Type | Description |
---|---|---|
session | string |
The session |