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

bravia-simple-ip-control

v1.0.1

Published

Control your Sony Bravia TV over the network

Downloads

17

Readme

bravia-simple-ip-control

Control your Sony Bravia TV over the network

NPM Version GitHub license

bravia-simple-ip-control is a Node.js library that allows you to control your Sony Bravia TV over your local network. It's especially useful for integrating into a home automation system.

Getting Started

bravia-simple-ip-control is distributed through NPM:

npm install bravia-simple-ip-control

# or, if you prefer:
yarn add bravia-simple-ip-control

Examples

bravia-simple-ip-control provides both discovery and control capabilities. To monitor the local network for Bravia TVs, try something like this:

import BraviaDiscovery from 'bravia-simple-ip-control';

BraviaDiscovery
    .on('founddevice', (device) => {
        console.log(`Found a device: ${device.id}`);
    })
    .on('lostdevice', (device) => {
        console.log(`Lost a device: ${device.id}`);
    })
    .discover();

Once you have a device object, you have a number of control commands at your disposal:

Commands

sendIrCode

Send an IR code to the TV. See KEYS for a full list of available IR code names.

isOn.get()

isOn.set(value)

isOn.toggle()

Get, set, or toggle the power state of the TV.

volume.get()

volume.set(value)

Get or set the current volume level.

isMuted.get()

isMuted.set(value)

Get or set the mute status.

channel.get()

channel.set(value)

Get or set the current channel.

tripletChannel.get()

tripletChannel.set(value)

Get or set the current "triplet" channel. (I don't currently know what a "triplet" channel is.)

inputSource.get()

inputSource.set(value)

Get or set the current input source (antenna, cable, etc).

input.get()

input.set(value)

Get or set the current input (HDMI, component, etc). Value is one of:

  • tv
  • hdmi
  • scart
  • composite
  • component
  • mirroring
  • pc-rgb

followed by a number 1-9999 (for any of the options except tv).

isPictureMuted.get()

isPictureMuted.set(value)

isPictureMuted.toggle()

Get, set, or toggle the picture mute feature. Picture mute turns off the screen without turning off the TV (in other words, audio only).

isPipEnabled.get()

isPipEnabled.set(value)

isPipEnabled.toggle()

Get, set, or toggle the Picture in Picture status. May not be supported by all models.

broadcastAddress.get(iface)

macAddress.get(iface)

Get the IP or hardware address of the given network interface.

sceneSetting.get()

sceneSetting.set(value)

Get or set the current scene setting value. One of:

  • auto
  • auto24pSync
  • general

Events

The following events are fired when it is detected that the corresponding state has changed:

power-changed

volume-changed

mute-changed

channel-changed

input-changed

piture-mute-changed

pip-changed

Compatibility

bravia-simple-ip-control is built to support Node.js version 6.0 or higher.

Contributing

Contributions are of course always welcome. If you find problems, please report them in the Issue Tracker. If you've made an improvement, open a pull request.

Getting set up for development is very easy:

git clone <your fork>
cd bravia-simple-ip-control
yarn

And the development workflow is likewise straightforward:

# make a change to the src/ file, then...
yarn build
node dist/example.js

# or if you want to clean up all the leftover build products:
yarn run clean

Release History

  • 1.0.0
    • The first release.

Meta

Zach Bean – [email protected]

Distributed under the MIT license. See LICENSE for more detail.