Socket
Book a DemoInstallSign in
Socket

biodome-client

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

biodome-client

API client for biodome

0.2.0
latest
Source
npmnpm
Version published
Weekly downloads
3
50%
Maintainers
1
Weekly downloads
 
Created
Source

biodome-client Build Status

JavaScript client for biodome

The biodome-client is how any services wishing to utilise the biodome server do so. Services include device scheduling, environment compensation, logging, UI client / control panel, emergency notification system, etc.

var biodomeClient = require('biodome-client');

var conf = {
  'host' : 'localhost:8888'
};

var client = biodomeClient(conf);

// sending commands to biodome server
// Will attempt to fetch and store a JWT token if it doesn't already have a valid one

client.read('outside_temp')
  .then(function(data) {
    // data is JSON data for endpoint with ID of "temperature"
  }).catch(function(err) {
    // oh. that's unfortunate.
  });

// write HIGH to endpoint with an ID of "light"
client.write('light', 1)
  .then(function(data) { ... });

// ...or you can use more complex selectors as first param
client.read({ 'type' : 'temperature' })
  .then(function(data) {
    // data is all JSON of matching endpoints
  });

// ...or call with your own command object
client.command({
  'selector' : {'type' : 'lights', 'value' : 1 },
  'instruction' : {'type' : 'write', 'value' : 0 }
}).then(function(endpoints)) {
  // endpoints is JSON data of affected endpoints
});

Keywords

automation

FAQs

Package last updated on 30 Jun 2015

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.