Skip to content

Commit

Permalink
fix: add support for HTTP proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Radek Novacek committed Dec 8, 2024
1 parent 8dfb98f commit 81e8306
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/cz_energy_spot_prices/cnb_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async def download_rates(self, day: date) -> str:
'date': day.strftime('%d.%m.%Y')
}

async with aiohttp.ClientSession() as session:
async with aiohttp.ClientSession(trust_env=True) as session:
async with session.get(self.RATES_URL, params=params) as response:
text = await response.text()
return text
Expand Down
2 changes: 1 addition & 1 deletion custom_components/cz_energy_spot_prices/spot_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_gas_query(self, start: date, end: date) -> str:

async def _download(self, query: str) -> str:
try:
async with aiohttp.ClientSession() as session:
async with aiohttp.ClientSession(trust_env=True) as session:
async with session.post(self.OTE_PUBLIC_URL, data=query) as response:
return await response.text()
except aiohttp.ClientError as e:
Expand Down

0 comments on commit 81e8306

Please sign in to comment.