enableUKalerts

This commit is contained in:
SpudGunMan
2024-12-18 19:39:55 -08:00
parent 454f823ad7
commit 06a14d875f
4 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -127,7 +127,7 @@ NOAAalertCount = 2
# use Open-Meteo API for weather data not NOAA useful for non US locations
UseMeteoWxAPI = False
includeEUalerts = False
enableUKalerts = False
# NOAA Hydrology
# unique identifiers, LID or USGS ID
+6 -6
View File
@@ -277,10 +277,7 @@ def handle_motd(message, message_from_id, isDM):
def handle_wxalert(message_from_id, deviceID, message):
if use_meteo_wxApi:
if useEUalerts:
return get_govUK_alerts()
else:
return "wxalert is not supported"
return "wxalert is not supported"
else:
location = get_node_location(message_from_id, deviceID)
if "wxalert" in message:
@@ -691,11 +688,14 @@ 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)
if enableUKalerts:
# UK Alerts
return get_govUK_alerts(str(location[0]), str(location[1]))
if message.lower().startswith("ealert"):
# Detailed alert
# Detailed alert FEMA
return getIpawsAlert(str(location[0]), str(location[1]))
else:
# Headlines only
# Headlines only FEMA
return getIpawsAlert(str(location[0]), str(location[1]), shortAlerts=True)
def handle_bbspost(message, message_from_id, deviceID):
+1 -1
View File
@@ -155,7 +155,7 @@ try:
latitudeValue = config['location'].getfloat('lat', 48.50)
longitudeValue = config['location'].getfloat('lon', -123.0)
use_meteo_wxApi = config['location'].getboolean('UseMeteoWxAPI', False) # default False use NOAA
useEUalerts = config['location'].getboolean('includeEUalerts', False) # default False
enableUKalerts = config['location'].getboolean('enableUKalerts', False) # default False
use_metric = config['location'].getboolean('useMetric', False) # default Imperial units
forecastDuration = config['location'].getint('NOAAforecastDuration', 4) # NOAA forcast days
numWxAlerts = config['location'].getint('NOAAalertCount', 2) # default 2 alerts
+1 -1
View File
@@ -74,7 +74,7 @@ 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"
if useEUalerts:
if enableUKalerts:
from modules.locationdata_eu import * # from the spudgunman/meshing-around repo
trap_list = trap_list + trap_list_location_eu
#help_message = help_message + ", ukalert, ukwx, ukflood"