Skip to content

Commit

Permalink
Accept 31 days
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Dec 21, 2024
1 parent 3d438aa commit fc11e96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/meters_to_ha/meters_to_ha.py
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,7 @@ def veolia_to_dict(self, csv_file) -> dict[str, Any] | None:
# Verify data integrity :
d1 = datetime.strptime(date, "%Y-%m-%d")
d2 = datetime.now()
if abs((d2 - d1).days) > 30:
if abs((d2 - d1).days) > 31:
raise RuntimeError(
f"File contains too old data (monthly?!?): {row!r}"
)
Expand Down Expand Up @@ -2394,7 +2394,7 @@ def update_veolia_device(self, csv_file):
# Verify data integrity :
d1 = datetime.strptime(date, "%Y-%m-%d")
d2 = datetime.now()
if abs((d2 - d1).days) > 30:
if abs((d2 - d1).days) > 31:
raise RuntimeError(
"File contains too old data (monthly?!?): "
+ str(row)
Expand Down Expand Up @@ -2592,7 +2592,7 @@ def update_veolia_device(self, csv_file):
# Verify data integrity :
d1 = datetime.strptime(date, "%Y-%m-%d")
d2 = datetime.now()
if abs((d2 - d1).days) > 30:
if abs((d2 - d1).days) > 31:
raise RuntimeError(
f"File contains too old data (monthly?!?): {row!r}"
)
Expand Down Expand Up @@ -2823,7 +2823,7 @@ def update_grdf_device(self, json_file):
# Use the most recent data.
continue

if abs((row_date_time - datetime.now(timezone.utc)).days) > 30:
if abs((row_date_time - datetime.now(timezone.utc)).days) > 31:
raise RuntimeError(
f"File contains too old data (monthly?!?): {row}"
)
Expand Down

0 comments on commit fc11e96

Please sign in to comment.