Skip to content

Commit

Permalink
Merge pull request #133 from mampfes/fix_epex_spot
Browse files Browse the repository at this point in the history
fix epex spot web scraper for CH and GB
  • Loading branch information
mampfes committed Jun 14, 2024
2 parents 84a8240 + ace2ecb commit 9e2441b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion custom_components/epex_spot/EPEXSpot/EPEXSpotWeb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ def _as_date(v):
return v.strftime("%Y-%m-%d")


MARKET_AREA_MAP = {"GB-30": {"market_area": "GB", "duration": 30}}
MARKET_AREA_MAP = {
"GB-30": {"auction": "30-call-GB", "market_area": "GB", "duration": 30},
"GB": {"auction": "GB", "market_area": "GB", "duration": 60},
"CH": {"auction": "CH", "market_area": "CH", "duration": 60},
}


class Marketprice:
Expand Down Expand Up @@ -100,9 +104,11 @@ def __init__(self, market_area, session: aiohttp.ClientSession):
if item is None:
self._int_market_area = market_area
self._duration = 60
self._auction = "MRC"
else:
self._int_market_area = item["market_area"]
self._duration = item["duration"]
self._auction = item["auction"]

self._marketdata = []

Expand Down Expand Up @@ -154,6 +160,7 @@ async def _fetch_data(self, delivery_date):
"market_area": self._int_market_area,
"trading_date": _as_date(trading_date),
"delivery_date": _as_date(delivery_date),
"auction": self._auction,
# "underlying_year": None,
"modality": "Auction",
"sub_modality": "DayAhead",
Expand Down

0 comments on commit 9e2441b

Please sign in to comment.