Skip to content

Commit cdd5b4e

Browse files
authored
Merge pull request #140 from mampfes/user_agent_for_epex_spot
add user_agent for EPEX Spot
2 parents 532eaec + 5bdf070 commit cdd5b4e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

custom_components/epex_spot/EPEXSpot/EPEXSpotWeb/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ async def _fetch_day(self, delivery_date):
156156

157157
async def _fetch_data(self, delivery_date):
158158
trading_date = delivery_date - timedelta(days=1)
159+
headers = {
160+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0" # noqa
161+
}
159162
params = {
160163
"market_area": self._int_market_area,
161164
"trading_date": _as_date(trading_date),
@@ -194,7 +197,7 @@ async def _fetch_data(self, delivery_date):
194197
}
195198

196199
async with self._session.post(
197-
self.URL, params=params, data=data, verify_ssl=False
200+
self.URL, headers=headers, params=params, data=data, verify_ssl=False
198201
) as resp:
199202
resp.raise_for_status()
200203
return await resp.json()

custom_components/epex_spot/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"iot_class": "cloud_polling",
99
"issue_tracker": "https://github.com/mampfes/ha_epex_spot/issues",
1010
"requirements": ["beautifulsoup4"],
11-
"version": "2.3.7"
11+
"version": "2.3.8"
1212
}

0 commit comments

Comments
 (0)