Skip to content

Commit

Permalink
Merge pull request #375 from viiru-/fix-dst-issue
Browse files Browse the repository at this point in the history
Reverse order of operations to properly ignore DST issues in data
  • Loading branch information
Hellowlol authored Jun 30, 2024
2 parents bb4bc52 + 7209e05 commit 98105c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/nordpool/aio_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ async def join_result_for_correct_time(results, dt):
local = val["start"].astimezone(zone)
local_end = val["end"].astimezone(zone)
if start_of_day <= local and local <= end_of_day:
if val['value'] in INVALID_VALUES:
raise InvalidValueException(f"Invalid value in {val} for area '{key}'")
if local == local_end:
_LOGGER.info(
"Hour has the same start and end, most likly due to dst change %s exluded this hour",
val,
)
elif val['value'] in INVALID_VALUES:
raise InvalidValueException(f"Invalid value in {val} for area '{key}'")
else:
fin["areas"][key]["values"].append(val)

Expand Down

0 comments on commit 98105c6

Please sign in to comment.