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

niko-home-control

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

niko-home-control

A connector for the Niko Home Control API

latest
Source
npmnpm
Version
0.4.3
Version published
Maintainers
1
Created
Source

Connector for the Niko Home Control API

Known Vulnerabilities

Init

const niko = require('niko-home-control');

niko.init({
  ip: 'xxx.xxx.xxx.xxx',
  port: 8000,
  timeout: 20000,
  events: true
});

events enables direct events from the controller, such as energy consumption and actions states.

Usage

Get the list of available locations

niko
  .listLocations()
  .then(function (response) {
    console.log(response);
  });

Get the list of available actions

niko
  .listActions()
  .then(function (response) {
    console.log(response);
  });

Perform an action

niko
  .executeActions(id, value)
  .then(function (response) {
    console.log(response);
  });

Get energy info

niko
  .listEnergy()
  .then(function (response) {
    console.log(response);
  });

Get system info

niko
  .systemInfo()
  .then(function (response) {
    console.log(response);
  });

Reveive energy consumption events

niko.events.on('getlive', (data) => {
  console.log(data, 'live');
});

Reveive actions states events

niko.events.on('listactions', (data) => {
  console.log(data, 'actions');
});

Keywords

Niko

FAQs

Package last updated on 27 Oct 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