New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

tizen-remote

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tizen-remote

Samsung smart tv 2016+ models remote control

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Samsung smart tv 2016+ models remote control over Wi-Fi

Instalation

npm install tizen-remote

Usage

  const tv = require('tizen-remote');
  
  //basic initialisation
  let token;
  let mac;
  tv.onTokenUpdate(newToken => {
    //you can save it premanenty and use anytime later
    token = newToken;
  });
  tv.init({
    pairingName: 'MyServiceName', //name, displayed on tv while pairing request
    ip: '192.168.0.100',          //tv ip address (required)
  });
  
  //turn on tv and get device information
  tv.isOn()
    .then(on => {
      if (on) {
        return tv.getInfo();
      } else {
        console.log('can not remoutly turn tv on without mac address');
      }
    })
    .then(info => {
      if (info) {
        console.log(info);
        mac = info.device.wifiMac; //tv WiFi interface mac address (necessary to turn tv on)
      }
    })
    .catch(err => {
      console.log(err);
    });
    
  ...
  
  //initialisation with auth-token
  tv.init({
    pairingName: 'MyServiceName', //name, displayed on tv while pairing request
    ip: '192.168.0.100',          //tv ip address (required)
    mac: mac,
    authToken: token
  });
  
  ...
  //Open a YouTube video on tv
  const search = require('youtube-search');

  search('An awesome video', {
    maxResults: 1, 
    key: '<Your Google API KEY>', 
    type: 'video'
  }, res => openYoutube(res[0].id));
  
  function openYoutube(videoId) {
    tv.isOn()
      .then(on => {
        if (!on) {
          return tv.turnOn();
        }
      })
      .then(() => tv.getAppList())      
      .then(apps => {
        if (apps.youtube) {
          return tv.getAppInfo(apps.youtube.id)
        }
      })
      .then(youtube => {
        if (youtube) {
          if (youtube.running) {
            console.log('YouTube already opened');
          }
          
          return tv.openApp(youtube.id, videoId);
        } else {
          return tv.openURL(`https://www.youtube.com/watch?v=${videoId}`);
        }
      })
      .catch(err => console.log(err));
    }

Keywords

Samsung

FAQs

Package last updated on 13 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts