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