Good Morning,
i am starting some things using the API
For this i have imported the Python library as instructed and i've used your example to get the aircraft from my sensors.
from opensky_api import OpenSkyApi
api = OpenSkyApi(USERNAME, PASSWORD)
states = api.get_my_states()
print(states)
for s in states.states:
print(s.sensors)
However when i run the script, it tells me:
NameError: name 'USERNAME' is not defined
I've replaced of course "USERNAME" with my real username.
Any idea where i need to start troubleshooting? username and password are accepted using the REST API