Open dingo35 opened 3 years ago
I suspect that the "page pointer" (which is basically the number of days it has data for) is updated at the start of the day, but the actual daily data is updated at the end of the day. Since data is returned in pages of 32 values, this is only an issue when there's a page rollover (where the pointer is already pointing to a new page which hasn't yet been filled with any data).
My code doesn't really do anything special: it retrieves the current page pointer and calculates the current page from that (Math.ceil(pagePointer / 32)
; page numbers starts at 1).
First of all big thanks for this great software!
I use it with a few bash scripts that will email me the daily usage in m3 and in "m3/graaddag", really love it!
BUT I discovered a small bug (that can only be discovered when using it on a daily basis, like I do): The Nefit boiler stores its usage data in pages; you can query the last page with <easy gas-usage "?"> . I noticed (on two different boilers) that on the day that the last entry on a page is filled, the query <easy --pretty gas-usage> will return an empty result.
So in detail: my current page is page 72, and it has currently only one entry, March 18th. <easy --pretty gas-usage> gives the expected result. YESTERDAY, however, I would expect it to give page 71, which would have the results from Feb 14th to March 17th. It returned an empty result "[]". Today, querying page 71: <easy --pretty gas-usage 71> gives the expected result again.