Skip to content

Commit ca73199

Browse files
committed
add UA
1 parent 7f675d6 commit ca73199

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

custom_components/rtetempo/api_worker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
API_VALUE_BLUE,
3232
FRANCE_TZ,
3333
HOUR_OF_CHANGE,
34+
USER_AGENT,
3435
)
3536

3637
_LOGGER = logging.getLogger(__name__)
@@ -222,7 +223,8 @@ def _get_tempo_data(
222223
"end_date": end_str[:-2] + ":" + end_str[-2:],
223224
}
224225
headers = {
225-
"Accept": "application/json"
226+
"Accept": "application/json",
227+
"User-Agent": USER_AGENT,
226228
}
227229
_LOGGER.debug(
228230
"Calling %s with start_date as '%s' and end_date as '%s'",

custom_components/rtetempo/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
API_VALUE_WHITE = "WHITE"
5353
API_VALUE_BLUE = "BLUE"
5454
API_ATTRIBUTION = "Données fournies par data.rte-france.com"
55+
USER_AGENT = "github.com/hekmon/rtetempo v1.2.1"
5556

5657

5758
# Tempo def

0 commit comments

Comments
 (0)