@bokub/linky
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "@bokub/linky", | ||
"description": "Easily retrieve your Linky power consumption", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"author": "bokub", | ||
"bugs": "https://github.com/bokub/linky/issues", | ||
"dependencies": { | ||
"axios": "^0.18.0", | ||
"dayjs": "^1.8.0" | ||
"axios": "^0.19.0", | ||
"dayjs": "^1.8.17" | ||
}, | ||
@@ -14,3 +14,3 @@ "devDependencies": { | ||
"codecov": "^3.1.0", | ||
"nyc": "^13.1.0", | ||
"nyc": "^14.1.1", | ||
"xo": "^0.23.0" | ||
@@ -17,0 +17,0 @@ }, |
@@ -27,24 +27,24 @@ # Linky | ||
// Log in | ||
const session = await linky.login('my-email@example.com', 'password'); | ||
linky.login('my-email@example.com', 'password').then(session => { | ||
// Retrieve your power consumption | ||
let data = await session.getDailyData(); | ||
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 }, | ||
// ... | ||
// ] | ||
// 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 | ||
data = await session.getDailyData({ | ||
start: '24/08/2018', | ||
end: '06/09/2018' | ||
// Use a custom time period | ||
session.getDailyData({ start: '24/08/2018', end: '06/09/2018' }).then(data => { | ||
console.log(data); | ||
}); | ||
}); | ||
``` | ||
@@ -51,0 +51,0 @@ |
44290
+ Addedaxios@0.19.2(transitive)
- Removedaxios@0.18.1(transitive)
- Removedis-buffer@2.0.5(transitive)
Updatedaxios@^0.19.0
Updateddayjs@^1.8.17