Skip to content

Commit

Permalink
Merge pull request #11 from dw86uk/old-property-fix
Browse files Browse the repository at this point in the history
Fixed lookup against old properties
  • Loading branch information
Yanson authored Nov 28, 2024
2 parents 3c34fff + 4347b62 commit b89806c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/octopus_to_influxdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ def collect(self, from_str: str, to_str: str):
self._process_intelligent_slots(self._intelligent_tariff_meter, tags)

for p in account['properties']:
self._process_property(p, collect_from, collect_to, tags)
if 'moved_out_at' in p and p['moved_out_at']:
click.echo(f"Skipping property at {p['address_line_1']}, {p['postcode']} due to move-out date being set.")
else:
self._process_property(p, collect_from, collect_to, tags)

def _process_property(self, p, collect_from: datetime, collect_to: datetime, base_tags: dict[str, str]):
tags = base_tags.copy()
Expand Down

0 comments on commit b89806c

Please sign in to comment.