npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ersinayaz/rn-samsung-tv-remote

v1.0.2

Published

React Native - Samsung Remote Controller

Downloads

8

Readme

React Native - Samsung TV Remote Control

This project is a proof of concept to remote control Samsung TV which require encrypted communication with the internal web service of the TV.

TOC

Installation

Using npm:

npm i @ersinayaz/rn-samsung-tv-remote

or using yarn:

yarn add @ersinayaz/rn-samsung-tv-remote

Usage

import { SamsungRemote, DeviceDiscovery } from '@ersinayaz/rn-samsung-tv-remote';

Find Lan Devices:

// ...
const devices = await DeviceDiscovery.discover("urn:samsung.com:device:RemoteControlReceiver:1");

devices:

[{"info": {"address": "192.168.1.xxx", "family": "IPv4", "port": 38092, "size": 347}, "target": "urn:samsung.com:device:RemoteControlReceiver:1"}]

Initialize

const tv = new SamsungRemote({ ip: device[0].info.address });
tv.init();

or

const tv = new SamsungRemote({ ip: device[0].info.address });
// identity = await tv.confirmPin("xxxx")
tv.init(identity);

Request PIN

tv.requestPin();

Confirm PIN

const identity = await tv.confirmPin("xxxx")

Connect

await tv.connect()

Send Key

tv.sendKey("KEY_MUTE");

onConnected Event

// It must be defined before the tv.connect() command.
tv.onConnected(()=>{
    alert("Connected")
});

Key Codes

The list of accepted keys may vary depending on the TV model, but the following list has some common key codes and their descriptions.

| KEY | Description | |-------------|:-------------:| | KEY_POWER | Power Off | | KEY_MENU | Menu | | KEY_CONTENTS| Smart Hub | | KEY_HOME | Home | | KEY_UP | Up | | KEY_DOWN | Down | | KEY_LEFT | Left | | KEY_RIGHT | Right | | KEY_VOLUP | Volume Up | | KEY_VOLDOWN | Volume Down | | KEY_MUTE | Mute | | KEY_CHLIST | Channel List | | KEY_CHUP | Channel Up | | KEY_CHDOWN | Channel Down | | KEY_SOURCE | Source | | KEY_INFO | Info | | KEY_HELP | Help | | KEY_TOOLS | Tools | | KEY_GUIDE | Guide | | KEY_RETURN | Return | | KEY_PLAY | Play | | KEY_PAUSE | Pause | | KEY_STOP | Stop | | KEY_REC | Record | | KEY_0 | 0 | | KEY_1 | 1 | | KEY_2 | 2 | | KEY_3 | 3 | | KEY_4 | 4 | | KEY_5 | 5 | | KEY_6 | 6 | | KEY_7 | 7 | | KEY_8 | 8 | | KEY_9 | 9 |

Click for other keys: (https://github.com/ersinayaz/rn-samsung-tv-remote/blob/master/Keys.md)

License

MIT

Donate

| Crypto | Wallet | |-------------|:-------------------------------------------:| | BTC | bc1qhq65mvfx4a6pdad386t85lm7ac6c2th535f2u0 | | ETH | 0xf053943DB59c8aE80570EdE12bAD33f26788CE6F | | USDT | 0xf053943DB59c8aE80570EdE12bAD33f26788CE6F |

Bitcoin Donate Button