fix dashboard SOS bug
This commit is contained in:
parent
104cab1c29
commit
65ab256b7f
@ -133,13 +133,13 @@ def check_emergency():
|
||||
# open emergency txt
|
||||
try:
|
||||
sos_file = ast.literal_eval(os.popen('cat /tmp/gps_data_user_sos.txt').read())
|
||||
if '@NOTICE' in sos_file['message'] and '@SOS' not in sos_file['message']:
|
||||
notice_header = '<span style="background-color: #ffffff; color: #008000;">NOTICE:</span>'
|
||||
else:
|
||||
if type(sos_file['time']) == str:
|
||||
loc_time = str(sos_file['time'])
|
||||
if type(sos_file['time']) == int or type(sos_file['time']) == float:
|
||||
loc_time = datetime.fromtimestamp(sos_file['time']).strftime(time_format)
|
||||
if '@NOTICE' in sos_file['message'] and '@SOS' not in sos_file['message']:
|
||||
notice_header = '<span style="background-color: #ffffff; color: #008000;">NOTICE:</span>'
|
||||
else:
|
||||
notice_header = '<span style="background-color: #ff0000; color: #ffffff;">EMERGENCY ACTIVATION</span>'
|
||||
value = Markup("""
|
||||
<h1 style="text-align: center;">""" + notice_header + """</h1>
|
||||
@ -166,7 +166,7 @@ def check_emergency():
|
||||
|
||||
""")
|
||||
return value
|
||||
except:
|
||||
except Exception as e:
|
||||
return ''
|
||||
|
||||
def aprs_to_latlon(x):
|
||||
|
Loading…
Reference in New Issue
Block a user