Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-rwe-smarterhome-lib

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-rwe-smarterhome-lib

RWE-SmartHome Library for Node.js

  • 0.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

RWE-SmarterHome Lib

RWE-SmarterHome is a Node.JS library for the RWE-SmartHome which directly communicates with the SmartHome central.

    var sh = require("./lib/smarthome");
    var smartHome = new sh("192.168.1.17");
    var DO_EXIT = false;
    
    smartHome.login("USERNAME", "PASSWORD", function (res, error) {
        if (res) {
            console.log("LOGIN COMPLETE");
    
            smartHome.init(function () {
                console.log("INIT COMPLETE");
    
                var devices = smartHome.devices;
    
                devices.forEach(function (device) {
                    console.log(device.Name + " (" + device.Id + ", " + device.Type + "): " + device.getFriendlyState());
                });
    
                var p = smartHome.getDeviceByName("Test");
                
                if (p)
                    p.setState(true);
    
            });
    
            smartHome.on("StatusChanged", function (device) {
                console.log("DEVICE STATUS CHANGED", device.Name, device.getFriendlyState());
            });
        } else {
            console.log("LOGIN ERROR", error);
        }
    });
    
    (function wait() {
        if (!DO_EXIT) setTimeout(wait, 1000);
    })();

Keywords

FAQs

Package last updated on 24 Dec 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc