Skip to content

Commit f44a0ac

Browse files
authored
Merge pull request #2770 from adafruit/dhalbert-patch-6
PyPortal_LeagueLevel: update to settings.toml
2 parents daaa773 + a9b15cb commit f44a0ac

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

  • PyPortal/PyPortal_LeagueLevel

PyPortal/PyPortal_LeagueLevel/code.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,17 @@
88
You'll need a Riot API key in your secrets.py file
99
If you can find something that spits out JSON data, we can display it!
1010
"""
11+
import os
1112
import time
1213
import board
1314
from adafruit_pyportal import PyPortal
1415

15-
try:
16-
from secrets import secrets
17-
except ImportError:
18-
print("WiFi secrets are kept in secrets.py, please add them there!")
19-
raise
20-
2116
#Choose a valid Summoner name
2217
SUMMONER_NAME = "RiotSchmick"
2318

2419
# Set up where we'll be fetching data from
2520
DATA_SOURCE = "https://na1.api.riotgames.com/lol/summoner/v4/summoners/by-name/"+SUMMONER_NAME
26-
DATA_SOURCE += "?api_key="+secrets['league_token']
21+
DATA_SOURCE += "?api_key=" + os.getenv("LEAGUE_TOKEN")
2722
DATA_LOCATION = ["summonerLevel"]
2823
CAPTION = "SUMMONER "+SUMMONER_NAME
2924

0 commit comments

Comments
 (0)