0.2.2 • Published 4 years ago

@bokub/linky v0.2.2

Weekly downloads
2
License
GPL-3.0-or-later
Repository
github
Last release
4 years ago

Linky

Version Build Status Engines Coverage Code style

Easily retrieve your Linky power consumption

If you are looking for a command-line tool, check out linky-cli

Install

$ npm i @bokub/linky

Usage

const linky = require('@bokub/linky');

// Log in
linky.login('my-email@example.com', 'password').then((session) => {
    // Retrieve your power consumption
    session.getDailyData().then((data) => {
        console.log(data);
        // [
        //   { date: '2018-09-28 00:00:00', value: 2.944 },
        //   { date: '2018-09-29 00:00:00', value: 2.704 },
        //   { date: '2018-09-30 00:00:00', value: 3.477 },
        //   { date: '2018-10-01 00:00:00', value: null },
        //   { date: '2018-10-02 00:00:00', value: 4.063 },
        //   { date: '2018-10-03 00:00:00', value: 3.209 },
        //   { date: '2018-10-04 00:00:00', value: 4.355 },
        //   ...
        // ]
    });

    // Use a custom time period
    session.getDailyData({ start: '24/08/2018', end: '06/09/2018' }).then((data) => {
        console.log(data);
    });
});

API

login(email, password)

Log into you customer area and retrieve a session that you can use to retrieve your power consumption

session.getHourlyData([options])

Retrieve power consumption with a step of 30 minutes

Default time period: Yesterday

session.getDailyData([options])

Retrieve power consumption with a step of 1 day

You cannot retrieve more than 31 days at once

Default time period: Last 31 days

session.getMonthlyData([options])

Retrieve power consumption with a step of 1 month

You cannot retrieve more than 12 months at once

Default time period: Last 12 months

session.getYearlyData([options])

Retrieve all your power consumption with a step of 1 year

You cannot use a custom time period

2.0.0-beta.3

4 years ago

2.0.0-beta.2

4 years ago

2.0.0-beta.1

4 years ago

2.0.0-beta.0

4 years ago

0.2.2

4 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

6 years ago