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

mystrom-switch

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mystrom-switch

mystrom-switch is a library that helps to turn on/off the myStorm wifi switch

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

mystrom-switch

mystrom-switch is a library that helps to turn on/off the myStorm wifi switch

Installation

npm install mystrom-switch

Usage

Power On

var MyStromIp = "192.168.1.69";
var MyStrom = require('mystrom-switch');
var plug = new MyStrom(MyStromIp);

// turn on myStrom wifi switch
plug.powerOn(function (result, err) {
    if (err) console.log(err);

	// If the switch has been well powered on
    if (result === true) {
		console.log("ok, it's on");
    }
});

Power Off

var MyStromIp = "192.168.1.69";
var MyStrom = require('mystrom-switch');
var plug = new MyStrom(MyStromIp);

// turn on myStrom wifi switch
plug.powerOff(function (result, err) {
    if (err) console.log(err);

	// If the switch has been well powered off
    if (result === true) {
		console.log("ok, it's on");
    }
});

Power Toggle

var MyStromIp = "192.168.1.69";
var MyStrom = require('mystrom-switch');
var plug = new MyStrom(MyStromIp);

// turn on myStrom wifi switch
plug.toggle(function (result, err) {
    if (err) console.log(err);

    if (result === true) {
		console.log("ok, it's on");
    }
});

Get Values

var MyStromIp = "192.168.1.69";
var MyStrom = require('mystrom-switch');
var plug = new MyStrom(MyStromIp);

// turn on myStrom wifi switch
plug.getValues(function (result, err) {
    if (err) console.log(err);

	console.log(result);
});

Keywords

mystrom

FAQs

Package last updated on 17 Jun 2017

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