eliq-promise

3.1.8 • Public • Published

eliq-promise

NPM version Downloads Actions Status Actions Status

A node.js module to interface with the ELIQ API

Prerequisites

ELIQ access token

Install

npm install eliq-promise

API

Setup

const config = {
  eliqAccesstoken: process.env['eliqAccesstoken'],
  url: process.env['url'],
  format: process.env['format'],
  logLevel: process.env['logLevel'],
}
const {EliqClient} = require('eliq-promise');
const eliq = new EliqClient(config);

eliq.getFrom(5, '6min').then(console.log).catch(console.log);

Now

eliq.getNow().then(console.log).catch(console.log);
=>
{ createddate: '2015-03-10T05:38:20', power: 1285 }

From

eliq.getFrom(<hours ago>, '6min' | 'hour' | 'day').then(console.log).catch(console.log);
=>
{ startdate: '2015-03-10T00:00:00+00:00',
  enddate: '2015-03-10T01:00:00+00:00',
  intervaltype: '6min',
  data:
   [ { avgpower: 1170,
       energy: 117,
       temp_out: null,
       time_start: '2015-03-10T00:00:00',
       time_end: '2015-03-10T00:06:00' },
   ...
   ]
}

From => To

eliq.getFromTo (<startdate>, <enddate>, '6min' | 'hour' | 'day').then(console.log).catch(console.log);
=>
{ startdate: '2015-03-02T20:00:00+00:00',
  enddate: '2015-03-02T23:00:00+00:00',
  intervaltype: '6min',
  data:
   [ { avgpower: 2790,
       energy: 279,
       temp_out: null,
       time_start: '2015-03-02T20:00:00',
       time_end: '2015-03-02T20:06:00' },
    ...
   ]
}

Readme

Keywords

Package Sidebar

Install

npm i eliq-promise

Weekly Downloads

0

Version

3.1.8

License

MIT

Unpacked Size

10 kB

Total Files

7

Last publish

Collaborators

  • ashpool