robertklep / nefit-easy-commands

High-level command implementation for Nefit Easy™ clients.
MIT License
13 stars 4 forks source link

Gasusage API #12

Closed RaimondB closed 4 years ago

RaimondB commented 4 years ago

I'd like to use the GasUage commands to get the gas usage for today or maybe yesterday, Can you point me in the right direction how to use the commands. I'm getting a bit confused with the paging stuff.

Thanks in advance!

robertklep commented 4 years ago

It's documented here.

In short (and from the top of my head; I don't own a Nefit Easy anymore so can't check): each gas usage page contains 32 entries, which correspond to 32 days. If you run the gasUsage command without a specific page index, it will retrieve the latest page (which holds the data for yesterday and the 31 days before that).

If you want to find out how many pages there are, use the gasUsagePage command. Pages start with (I think) 1, which contains the oldest data.

RaimondB commented 4 years ago

Thanks I have got it working