Skip to content

Commit

Permalink
Try fixing #23
Browse files Browse the repository at this point in the history
  • Loading branch information
jpulakka committed Oct 31, 2022
1 parent 359293a commit 5202377
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/nordpool_diff/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _get_next_n_hours_from_nordpool(n, np):

def _get_next_n_hours_from_entsoe(n, e):
prices = []
if p := e.attributes["prices"]:
if p := e.attributes.get("prices"):
hour_before_now = dt.utcnow() - timedelta(hours=1)
for item in p:
if prices or hour_before_now <= datetime.fromisoformat(item["time"]):
Expand Down

0 comments on commit 5202377

Please sign in to comment.