fix dashboard SOS bug

This commit is contained in:
KF7EEL 2021-03-02 14:05:15 -08:00
parent 67f2093ff3
commit 6b49e069e8

View File

@ -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):