Skip to content

Commit

Permalink
Merge pull request #1 from bodji/dev
Browse files Browse the repository at this point in the history
Ignore invalid values from Enedis, such as negative measures
  • Loading branch information
bodji authored May 4, 2019
2 parents fa92ebc + ba78cb1 commit 0875efb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions enedis/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ func (c *Client) GetData(resolution string, from time.Time, to time.Time) (power
// Make pretty response
for _, measure := range enedisDataReturn.Graphe.Data {

// Ignore invalid measures
if measure.Value <= 0 {
continue
}

// Create new measure
pm := new(PowerMeasure)

Expand Down

0 comments on commit 0875efb

Please sign in to comment.