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

wifiradio

v0.4.1

Published

NodeJS module for controlling WiFi-radios

Downloads

32

Readme

WiFi-Radio

test version downloads

NodeJS module for controlling WiFi-radios

Installation

npm install wifiradio --save

Usage

const Wifiradio = require('wifiradio');

const ip = '192.168.178.27'; // Change this to the ip adress of your radio
const pin = '1234'; // This is the default PIN for the radio. (Works in most cases)

const radio = new Wifiradio(ip, pin);

radio.setPower(1).then(() => {
  radio.getPower().then(result => {
    console.log(`Power: ${result}`);
  });
});

radio.getMute().then(result => {
  console.log(`Mute: ${result}`);
});

radio.getText().then(result => {
  console.log(`Text: ${result}`);
});

radio.getMode().then(result => {
  console.log(`Mode: ${result}`);
});

Features

This page lists all commands that are directly accessible with the use of this library. These commands only provide a very simple high-level access to the features of your radio.

:warning: For more advanced use cases I suggest that you may take a look at this very extensive list of possible commands and don't use the functions listed below but rather access the API via the following function for direct access:

Direct Access

radio.get('sys.sleep').then(console.log);
radio.get('netRemote.sys.sleep').then(console.log);

radio.set('sys.sleep', 60).then(console.log);

radio.get('sys.info.friendlyname').then(console.log);
radio.set('sys.audio.volume', 5).then(console.log);

Power

// Turn on
radio.setPower(1);

// Turn off
radio.setPower(0);

// Get whether the radio is on or off (returns 0 or 1)
radio.getPower().then(console.log);

Mute

// Mute on
radio.setMute(1);

// Mute off
radio.setMute(0);

// Get whether the radio is mute or not (returns 0 or 1)
radio.getMute().then(console.log);

Volume

// Set volume (value from 1-20)
radio.setVolume(10);

// Get the current volume (returns a value from 1-20)
radio.getVolume().then(console.log);

Modes

// Set a mode
radio.setMode(2);

// Get the current playing mode
radio.getMode().then(console.log);

Display

// Get the first line of the display
radio.getName().then(console.log);

// Get the second line of the display
radio.getText().then(console.log);

Contributing

There are many more requests that could be done by this module. If you think that something is missing just open an issue for that or make a pull request. If you need some help, you can have a look here for some further requests.

License

GPL-3.0