tcl-remote
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

TCL Remote

The idea of this proyect is to provide a node interface for interacting with the TCL remote control protocol.

This project was bootstrapped with TSDX.

Examples

import { Finder, Device, Remote } from 'tcl-remote';
import { Keys } from 'tcl-remote/Remote';
 
async function main(): void {
  const finder = new Finder();
 
  // Find the first possible location of a TCL tv
  const location = await finder.find();
  await finder.close();
 
  console.log('location', location);
 
  // Create a Device Object to get information about the device
  const device = new Device(location);
  const props = await device.fetch();
 
  console.log(props);
 
  // Should probably use a better regex to match the ip
  const match = location.match(/(\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?)/);
 
  if (match) {
    // Create a remote instance
    const device = new Remote(match[1]);
 
    //Press the mute key
    await device.press(Keys.Mute);
 
    device.close();
  }
}
 
main();

See Examples

Related projects

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i tcl-remote

    Weekly Downloads

    2

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    80.2 kB

    Total Files

    17

    Last publish

    Collaborators

    • nickcis