File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 5656osn_header = {"Authorization" : "Basic " + str (base64cred )}
5757OPENSKY_SOURCE = "https://opensky-network.org/api/states/all?" + "icao24=" + transponder
5858
59+
5960# Converts seconds to human readable minutes/hours/days
6061def time_calc (input_time ): # input_time in seconds
6162 if input_time < 60 :
@@ -72,6 +73,7 @@ def time_calc(input_time): # input_time in seconds
7273 time_output = f"{ sleep_int :.1f} days"
7374 return time_output
7475
76+
7577def _format_datetime (datetime ):
7678 return "{:02}/{:02}/{} {:02}:{:02}:{:02}" .format (
7779 datetime .tm_mon ,
@@ -82,6 +84,7 @@ def _format_datetime(datetime):
8284 datetime .tm_sec ,
8385 )
8486
87+
8588# Connect to Wi-Fi
8689print ("\n ===============================" )
8790print ("Connecting to WiFi..." )
@@ -105,7 +108,7 @@ def _format_datetime(datetime):
105108
106109 print ("\n Attempting to GET OpenSky-Network Data!" )
107110 opensky_response = request .get (url = OPENSKY_SOURCE , headers = osn_header ).json ()
108-
111+
109112 # Print Full JSON to Serial (doesn't show credentials)
110113 debug_response = False # Set True to see full response
111114 if debug_response :
Original file line number Diff line number Diff line change 7070 + lonmax
7171)
7272
73+
7374# Converts seconds to human readable minutes/hours/days
7475def time_calc (input_time ): # input_time in seconds
7576 if input_time < 60 :
@@ -86,6 +87,7 @@ def time_calc(input_time): # input_time in seconds
8687 time_output = f"{ sleep_int :.1f} days"
8788 return time_output
8889
90+
8991def _format_datetime (datetime ):
9092 return "{:02}/{:02}/{} {:02}:{:02}:{:02}" .format (
9193 datetime .tm_mon ,
@@ -96,6 +98,7 @@ def _format_datetime(datetime):
9698 datetime .tm_sec ,
9799 )
98100
101+
99102# Connect to Wi-Fi
100103print ("\n ===============================" )
101104print ("Connecting to WiFi..." )
@@ -119,7 +122,7 @@ def _format_datetime(datetime):
119122
120123 print ("\n Attempting to GET OpenSky-Network Data!" )
121124 opensky_response = request .get (url = OPENSKY_SOURCE , headers = osn_header ).json ()
122-
125+
123126 # Print Full JSON to Serial (doesn't show credentials)
124127 debug_response = False # Set True to see full response
125128 if debug_response :
Original file line number Diff line number Diff line change 3434# example https://opensky-network.org/api/states/all?icao24=a808c5
3535OPENSKY_SOURCE = "https://opensky-network.org/api/states/all?" + "icao24=" + transponder
3636
37+
3738# Converts seconds to human readable minutes/hours/days
3839def time_calc (input_time ): # input_time in seconds
3940 if input_time < 60 :
@@ -50,6 +51,7 @@ def time_calc(input_time): # input_time in seconds
5051 time_output = f"{ sleep_int :.1f} days"
5152 return time_output
5253
54+
5355def _format_datetime (datetime ):
5456 return "{:02}/{:02}/{} {:02}:{:02}:{:02}" .format (
5557 datetime .tm_mon ,
@@ -60,6 +62,7 @@ def _format_datetime(datetime):
6062 datetime .tm_sec ,
6163 )
6264
65+
6366# Connect to Wi-Fi
6467print ("\n ===============================" )
6568print ("Connecting to WiFi..." )
You can’t perform that action at this time.
0 commit comments