fix: replace hardcoded St. Petersburg weather with IP geolocation - #12
Merged
Conversation
The background context worker had Open-Meteo coordinates and a location
label hardcoded to St. Petersburg, FL, so every JARVIS install — anywhere
in the world — reported St. Pete weather. Embarrassing for anyone running
this outside Tampa Bay.
- Resolves location dynamically via ipwho.is (no API key required),
cached for 15 minutes
- New env overrides for pinned locations:
WEATHER_LATITUDE / WEATHER_LONGITUDE (required pair to pin)
WEATHER_LOCATION_LABEL (display string, optional)
WEATHER_UNIT (fahrenheit | celsius, defaults to fahrenheit)
- Defaults to Fahrenheit to preserve existing behavior
- Falls back to "Weather data unavailable." silently if both env
override and IP lookup fail (no behavior regression)
- Removes the dead `async def fetch_weather()` wttr.in helper that
wasn't called from anywhere; the only live weather path was the
background worker in `_ctx_cache`
Tested live: IP-only path resolves to the caller's actual city,
env-override path correctly switches to specified lat/lon/unit.
Approach adapted from @devon7y's weather fix in PR #4.
Co-Authored-By: devon7y <devon7y@users.noreply.github.com>
ethanplusai
force-pushed
the
fix/weather-geolocation
branch
from
May 15, 2026 02:40
8a52914 to
df44e40
Compare
DavidN0809
referenced
this pull request
in Nichols-HomeLab/jarvis
Aug 17, 2026
…ile-maintenance into main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The background context worker in `server.py` had Open-Meteo coordinates and a location label hardcoded to St. Petersburg, FL (lat 27.77, lon -82.64), so every JARVIS install — anywhere in the world — reported St. Pete weather. Embarrassing for anyone running this outside Tampa Bay. 🌴
What changed
Test plan
Approach adapted from @devon7y's larger PR #4, extracted as a focused, standalone change.
🤖 Generated with Claude Code