Skip to content

Commit a6fd529

Browse files
committed
Change log level of semsportal login to debug and increase request timeouts
1 parent 799e153 commit a6fd529

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/sems_portal_api_handler.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _login(self) -> None:
2727
This has to be done every time a request is made to the API since the authentication tokens expire after a few
2828
seconds.
2929
"""
30-
self.log.trace("Logging in into the SEMSPORTAL...")
30+
self.log.debug("Logging in into the SEMSPORTAL")
3131
url = "https://www.semsportal.com/api/v1/Common/CrossLogin"
3232
headers = {
3333
"Content-Type": "application/json",
@@ -38,7 +38,7 @@ def _login(self) -> None:
3838
"pwd": EnvironmentVariableGetter.get("SEMSPORTAL_PASSWORD"),
3939
}
4040

41-
response = requests.post(url, headers=headers, json=payload, timeout=10)
41+
response = requests.post(url, headers=headers, json=payload, timeout=15)
4242
response.raise_for_status()
4343
response = response.json()
4444

@@ -97,7 +97,7 @@ def _retrieve_energy_consumption_data(self) -> dict:
9797
"date": TimeHandler.get_date_as_string(),
9898
}
9999

100-
response = requests.post(url, headers=headers, json=payload, timeout=20)
100+
response = requests.post(url, headers=headers, json=payload, timeout=30)
101101
response.raise_for_status()
102102
response = response.json()
103103

@@ -260,7 +260,7 @@ def _retrieve_power_data(self, date_to_crawl: date) -> dict:
260260
"full_script": False,
261261
}
262262

263-
response = requests.post(url, headers=headers, json=payload, timeout=20)
263+
response = requests.post(url, headers=headers, json=payload, timeout=30)
264264
response.raise_for_status()
265265
response = response.json()
266266

0 commit comments

Comments
 (0)