ruudverheijden / node-p1-reader

Node.js package for reading and parsing data from the P1 port of a Dutch or Belgian Smart Meter.
MIT License
25 stars 25 forks source link

count longPowerFailureLog #4

Closed timoline closed 7 years ago

timoline commented 7 years ago

found a small bug in longPowerFailureLog numberOfLongPowerFailures is 1 but later it shows 0

events/dsmr/electricity/numberOfPowerFailures : 2 events/dsmr/electricity/numberOfLongPowerFailures : 1 events/dsmr/electricity/longPowerFailureLog*/0/startOfFailure : 2014-11-23T03:55:39.000Z events/dsmr/electricity/longPowerFailureLog/0/endOfFailure : 2016-04-05T01:52:29.000Z events/dsmr/electricity/longPowerFailureLog/0/duration : 43109810 events/dsmr/electricity/longPowerFailureLog/0/unit : s

ruudverheijden commented 7 years ago

The "0" values are correct cause an array is being returned. Arrays always start with a 0 index. However, I did spot an issue in the returned object due to your report. The structure being returned was not according to the readme docs any more. It was not returning the "count" and "log" elements. This is now fixed in version 1.4.1 Please have a look at it ;)

timoline commented 7 years ago

Ok I understand , no problem 1.4.1 is looking good :-)