install and transpile
npm ci
start
npm start
then open :3000 in your browser, enter the hostname/ip of your googleTV and click init.
enter the code from the tv when prompted.
you can use the up/down/left/right/back/enter buttons to test the remote.
from here on out you can control the googletv over socket.io, it'll re-use the hostname and connection upon restart.
- connect to socket
- (register event handler for
secretCodeRequest
- for setup) - emit
init
with hostname/ip - listen for
init
from server - emit
key
event with key code - go crazy
name | args | type | description |
---|---|---|---|
init |
hostname |
string | initialize the connection to the tv |
code |
code |
string | enter the code from the tv |
key |
key |
number | send a key to the tv (numeric format, see below) |
name | args | type | description |
---|---|---|---|
init |
tv is initialized, also emitted when reconnecting | ||
secretCodeRequest |
code |
string | tv requests a pairing code |
power |
state |
boolean | tv is turned on/off |
currentApp |
app |
string | tv changes app |
volumeState |
state |
object | tv changes volume |
error |
error |
string | error occurred |
ready |
connection is ready¨ | ||
unpaired |
tv is unpaired |
interface VolumeState {
current: number
max: number
isMuted: boolean
}
see here