Skip to content

Commit

Permalink
Schneider HH parser: Cope with clocking
Browse files Browse the repository at this point in the history
  • Loading branch information
tlocke committed Oct 23, 2024
1 parent 216ad53 commit 8bdea29
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions chellow/e/hh_parser_schneider_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@ def find_hhs(sheet, set_line_number, mpan_core):
reading = get_dec(sheet, "B", row)

if pres_reading is not None:
datum = {
"mpan_core": mpan_core,
"channel_type": "ACTIVE",
"start_date": start_date,
"value": pres_reading - reading,
"status": "A",
}
yield datum
value = pres_reading - reading
if value >= 0:
yield {
"mpan_core": mpan_core,
"channel_type": "ACTIVE",
"start_date": start_date,
"value": value,
"status": "A",
}
pres_reading = reading
except BadRequest as e:
e.description = f"Problem at line number: {row}: {e.description}"
Expand Down

0 comments on commit 8bdea29

Please sign in to comment.