Uncommented distance printing, prevent error when base location is not set
This commit is contained in:
parent
ce5a0a10a4
commit
704dc0a8d2
|
@ -110,7 +110,7 @@ def get_current_location(dictionary={}):
|
||||||
if gps_data.get("altitude"):
|
if gps_data.get("altitude"):
|
||||||
dictionary["altitude"] = gps_data["altitude"]
|
dictionary["altitude"] = gps_data["altitude"]
|
||||||
|
|
||||||
if "latitude" in base_location:
|
if type(base_location) == dict and 'latitude' in base_location:
|
||||||
dictionary["baseLatitude"] = base_location["latitude"]
|
dictionary["baseLatitude"] = base_location["latitude"]
|
||||||
dictionary["baseLongitude"] = base_location["longitude"]
|
dictionary["baseLongitude"] = base_location["longitude"]
|
||||||
if base_location.get("altitude"):
|
if base_location.get("altitude"):
|
||||||
|
@ -271,8 +271,8 @@ def collect_data(filename, address):
|
||||||
data["timestamp"] = time.time()
|
data["timestamp"] = time.time()
|
||||||
|
|
||||||
# Send to server
|
# Send to server
|
||||||
# print(f"\nDistance: {data.get('distance')}")
|
print(f"\nDistance: {data.get('distance')}")
|
||||||
print(f"\nService: {data.get('network information')}")
|
print(f"Service: {data.get('network information')}")
|
||||||
print(f"Ping Time: {data.get('ping_time')}")
|
print(f"Ping Time: {data.get('ping_time')}")
|
||||||
print(
|
print(
|
||||||
f"RSRP: {data.get('RSRP PRX')} {data.get('RSRP DRX')} {data.get('RSRP RX2')} {data.get('RSRP RX3')}"
|
f"RSRP: {data.get('RSRP PRX')} {data.get('RSRP DRX')} {data.get('RSRP RX2')} {data.get('RSRP RX3')}"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user