diff --git a/README.md b/README.md index b120c20..22e27ff 100644 --- a/README.md +++ b/README.md @@ -367,8 +367,9 @@ There is no direct support for MQTT in the code, however, reports from Discord a | `hfcond` | Returns a table of HF solar conditions | | | `tide` | Returns the local tides (NOAA data source) | | `rlist` | Returns a table of nearby repeaters from RepeaterBook | | -| `wx` and `wxc` | Return local weather forecast (wxc is metric value), NOAA or Open Meteo for weather forecasting | -| `wxa` and `wxalert` | Return NOAA alerts. Short title or expanded details | +| `wx` and `wxc` | Return local weather forecast (wxc is metric value), NOAA or Open Meteo for weather forecasting | | +| `wxa` and `wxalert` | Return NOAA alerts. Short title or expanded details | | +| `ea` and `ealert` | Return FEMA iPAWS/EAS alerts. Headline or expanded details | | ### Bulletin Board & Mail | Command | Description | | diff --git a/mesh_bot.py b/mesh_bot.py index 1fabe5f..6b8b8fd 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -45,6 +45,8 @@ def auto_response(message, snr, rssi, hop, pkiStatus, message_from_id, channel_n "cqcq": lambda: handle_ping(message_from_id, deviceID, message, hop, snr, rssi, isDM, channel_number), "cqcqcq": lambda: handle_ping(message_from_id, deviceID, message, hop, snr, rssi, isDM, channel_number), "dopewars": lambda: handleDopeWars(message, message_from_id, deviceID), + "ea": lambda: handle_fema_alerts(message, message_from_id, deviceID), + "ealert": lambda: handle_fema_alerts(message, message_from_id, deviceID), "email:": lambda: handle_email(message_from_id, message), "games": lambda: gamesCmdList, "globalthermonuclearwar": lambda: handle_gTnW(), @@ -73,7 +75,6 @@ def auto_response(message, snr, rssi, hop, pkiStatus, message_from_id, channel_n "testing": lambda: handle_ping(message_from_id, deviceID, message, hop, snr, rssi, isDM, channel_number), "tide": lambda: handle_tide(message_from_id, deviceID, channel_number), "videopoker": lambda: handleVideoPoker(message, message_from_id, deviceID), - "ealert": lambda: handle_fema_alerts(message, message_from_id, deviceID), "whereami": lambda: handle_whereami(message_from_id, deviceID, channel_number), "whoami": lambda: handle_whoami(message_from_id, deviceID, hop, snr, rssi, pkiStatus), "wiki:": lambda: handle_wiki(message, isDM), @@ -618,7 +619,12 @@ def handle_wxc(message_from_id, deviceID, cmd): def handle_fema_alerts(message, message_from_id, deviceID): location = get_node_location(message_from_id, deviceID) - return getIpawsAlert(str(location[0]), str(location[1])) + if message.lower().startswith("ealert"): + # Detailed alert + return getIpawsAlert(str(location[0]), str(location[1])) + else: + # Headlines only + return getIpawsAlert(str(location[0]), str(location[1]), shortAlerts=True) def handle_bbspost(message, message_from_id, deviceID): if "$" in message and not "example:" in message: diff --git a/modules/locationdata.py b/modules/locationdata.py index e52b3ef..2b00765 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -9,7 +9,7 @@ import bs4 as bs # pip install beautifulsoup4 import xml.dom.minidom from modules.log import * -trap_list_location = ("whereami", "tide", "moon", "wx", "wxc", "wxa", "wxalert", "rlist", "ealert") +trap_list_location = ("whereami", "tide", "moon", "wx", "wxc", "wxa", "wxalert", "rlist", "ea", "ealert") def where_am_i(lat=0, lon=0, short=False, zip=False): whereIam = "" diff --git a/modules/system.py b/modules/system.py index f71bb68..11330a8 100644 --- a/modules/system.py +++ b/modules/system.py @@ -72,14 +72,14 @@ if enableCmdHistory: if location_enabled: from modules.locationdata import * # from the spudgunman/meshing-around repo trap_list = trap_list + trap_list_location # items tide, whereami, wxc, wx - help_message = help_message + ", whereami, wx, wxc, rlist, ealert" + help_message = help_message + ", whereami, wx, wxc, rlist" # Open-Meteo Configuration for worldwide weather if use_meteo_wxApi: from modules.wx_meteo import * # from the spudgunman/meshing-around repo else: # NOAA only features - help_message = help_message + ", wxa, tide" + help_message = help_message + ", wxa, tide, ealert" # BBS Configuration if bbs_enabled: