Skip to content

Commit

Permalink
Merge pull request #16 from mampfes/fix_invalid_prices
Browse files Browse the repository at this point in the history
fix bug introduced with version 1.2.1
  • Loading branch information
mampfes authored Apr 8, 2024
2 parents d1cfdd1 + 44183f3 commit 23492ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion custom_components/epex_spot_sensor/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"integration_type": "helper",
"iot_class": "calculated",
"issue_tracker": "https://github.com/mampfes/ha_epex_spot_sensor/issues",
"version": "1.2.1"
"version": "1.2.2"
}
9 changes: 5 additions & 4 deletions custom_components/epex_spot_sensor/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ class Marketprice:
def __init__(self, entry):
self._start_time = cv.datetime(entry["start_time"])
self._end_time = cv.datetime(entry["end_time"])
if x := entry.get("price_eur_per_mwh") is not None:
if (x := entry.get("price_eur_per_mwh")) is not None:
self._price = x
self._price_uom = "EUR/MWh"
elif x := entry.get("price_gbp_per_mwh") is not None:
print(f"start={entry['start_time']}, price={x}")
elif (x := entry.get("price_gbp_per_mwh")) is not None:
self._price = x
self._price_uom = "GBP/MWh"
elif x := entry.get("price_ct_per_kwh") is not None:
elif (x := entry.get("price_ct_per_kwh")) is not None:
self._price = x
self._price_uom = "ct/kWh"
elif x := entry.get("price_pence_per_kwh") is not None:
elif (x := entry.get("price_pence_per_kwh")) is not None:
self._price = x
self._price_uom = "pence/kWh"
else:
Expand Down

0 comments on commit 23492ad

Please sign in to comment.