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

node-logicmachine-api

v0.1.2

Published

LogicMachine Remote services API (evika.ru)

Downloads

8

Readme

node-logicmachine-api

Build Status

NodeJS API module for LogicMachine Remote services

Logo

LogicMahine Versions

Tested on v3 (LogicMachine3 Light).

Installation

npm install --save node-logicmachine-api

Usage

Module init params:

var logicmachineApi = require('node-logicmachine-api')({
    host: '10.10.10.10',     // {String} default '192.168.0.10:80'
    username: 'bob',         // {String} default 'remote'
    password: 'sponge',      // {String} default 'remote'
    protocol: 'https',       // {String} default 'http'
    format: 'json',          // {String} default 'json' ['json', 'xml', 'rss']
    apiPath: '/secret-path', // {String} default '/cgi-bin/scada-remote/request.cgi'
    logger: logger.debug     // {Function|Boolean} default console.log
})
var logicmachineApiDefault = require('node-logicmachine-api')();

logicmachineApiDefault.setObjectValue('1/1/1/', '1', function (err, data) {
    if (err) {
        console.log('Error: ' + err);
    }
    // do stuff
});
var logicmachineApiCustom = require('node-logicmachine-api')({
    host: '10.10.10.10:8080',
    username: 'bob',
    password: 'sponge',
    logger: false
});

logicmachineApiCustom.getObjects(function (err, data) {
    if (err) {
        console.log('Error: ' + err);
    }
    // do stuff
});

Methods

All methods with callback will call it with (err, data) params:

err {Error|undefined};

data {Object|Array|Boolean|undefined}.

Objects address format:

1/1/1.

|Method|Description| |---|---| | getAlerts(callback) | callback {Function} Returns last 50 alerts | | getErrors(callback) | callback {Function} Returns last 50 errors | | getObjects(callback) | callback {Function} Returns objects marked as export sorted by last update time | | findObject(address, callback) | address {String} [required] callback {Function} Returns object value by address | | getObjectValue(address, callback) | address {String} [required] callback {Function} Returns current object value by address | | setObjectValue(address, value, callback) | address {String} [required] value {String} [required] callback {Function} Set object value by address | | setObjectValueWithoutKNX(address, value, callback) | address {String} [required] value {String} [required] callback {Function} Set object value by address without sending message to KNX | | sendResponseToKNXObject(address, value, callback) | address {String} [required] value {String} [required] callback {Function} Send response to KNX by object address | | sendReadToKNXObject(address, value, callback) | address {String} [required] callback {Function} Send read message to KNX by object address | | createUrl(query) | query {Object} object of URL params Create custom API url |

Development

Run tests: npm test;

Run Grunt watch: grunt watch.

Contributing

Please take care to maintain the existing coding style, unit tests for any changed functionality. Use npm run lint and npm test your code.

Release History

  • 0.1.2 Migrate to NodeJs v5, update dependencies, use standard code style
  • 0.1.1 Update initial params, add logger configuration
  • 0.1.0 Initial release

Links:

License

Copyright (c) 2016 Anton Fisher

MIT License. Free use and change.