Skip to content

Commit

Permalink
ea and ealert
Browse files Browse the repository at this point in the history
It's in the Bot, not a game, its FEMA. 🦺
  • Loading branch information
SpudGunMan committed Dec 12, 2024
1 parent 0749df0 commit b2eae85
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | |
Expand Down
10 changes: 8 additions & 2 deletions mesh_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion modules/locationdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
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 = ""
Expand Down
4 changes: 2 additions & 2 deletions modules/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@
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:
Expand Down

0 comments on commit b2eae85

Please sign in to comment.