Fix None user, was passing as string not NoneType

This commit is contained in:
Jxck-S 2020-09-19 16:28:28 -04:00
parent 7483fe261a
commit 9c58933084
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ def pullOpenSky(TRACK_PLANE):
config.read('config.ini') config.read('config.ini')
from opensky_api import OpenSkyApi from opensky_api import OpenSkyApi
planeData = None planeData = None
opens_api = OpenSkyApi(config.get('OPENSKY', 'USERNAME'), config.get('OPENSKY', 'PASSWORD')) opens_api = OpenSkyApi(username= None if config.get('OPENSKY', 'USERNAME').upper() == "NONE" else config.get('OPENSKY', 'USERNAME'), password= None if config.get('OPENSKY', 'PASSWORD').upper() == "NONE" else config.get('OPENSKY', 'PASSWORD').upper())
failed = False failed = False
try: try:
planeData = opens_api.get_states(time_secs=0, icao24=TRACK_PLANE.lower()) planeData = opens_api.get_states(time_secs=0, icao24=TRACK_PLANE.lower())