diff --git a/config.ini.example b/config.ini.example index 172a1ad..ee8a965 100644 --- a/config.ini.example +++ b/config.ini.example @@ -152,6 +152,14 @@ tide_api_key = # Tide update interval in seconds (future feature) tide_update_interval = 1800 +# N2YO API key for satellite pass information +# Get free key at: https://www.n2yo.com/login/ +n2yo_api_key = + +# AirNow API key for AQI data +# Get free key at: https://docs.airnowapi.org/ +airnow_api_key = + [Weather] # Default state for city name disambiguation # When users type "wx seattle", it will search for "seattle, WA, USA" @@ -174,11 +182,3 @@ url_timeout = 10 # true: Use 24-hour UTC format # false: Use 12-hour local format use_zulu_time = false - -# N2YO API key for satellite pass information -# Get free key at: https://www.n2yo.com/login/ -n2yo_api_key = - -# AirNow API key for AQI data -# Get free key at: https://www.airnowapi.org/ -airnow_api_key = diff --git a/modules/commands/aqi_command.py b/modules/commands/aqi_command.py index 92f29a5..cfbd2ef 100644 --- a/modules/commands/aqi_command.py +++ b/modules/commands/aqi_command.py @@ -37,7 +37,7 @@ class AqiCommand(BaseCommand): self.default_state = self.bot.config.get('Weather', 'default_state', fallback='WA') # Get AirNow API key from config - self.api_key = self.bot.config.get('Solar_Config', 'airnow_api_key', fallback='') + self.api_key = self.bot.config.get('External_Data', 'airnow_api_key', fallback='') if not self.api_key: self.logger.warning("AirNow API key not configured in config.ini") @@ -283,7 +283,7 @@ class AqiCommand(BaseCommand): """Get AQI data for a location (zipcode, city, or coordinates)""" try: if not self.api_key: - return "AirNow API key not configured. Please add airnow_api_key to config.ini" + return "AirNow API key not configured. Please add airnow_api_key to [External_Data] section in config.ini" # Convert location to lat/lon if location_type == "zipcode": diff --git a/modules/solar_conditions.py b/modules/solar_conditions.py index 7d84cd3..05b7b33 100644 --- a/modules/solar_conditions.py +++ b/modules/solar_conditions.py @@ -353,7 +353,7 @@ def get_next_satellite_pass(satellite, lat=None, lon=None): lon = get_config_value('Solar_Config', 'default_longitude', DEFAULT_LONGITUDE) # API URL - n2yo_key = get_config_value('Solar_Config', 'n2yo_api_key', DEFAULT_N2YO_API_KEY) + n2yo_key = get_config_value('External_Data', 'n2yo_api_key', DEFAULT_N2YO_API_KEY) if not n2yo_key: logger.error("System: Missing API key free at https://www.n2yo.com/login/") return "not configured, bug your sysop"