Repository navigation
Backport #21397 to v4-6-0: Keep weather units accurate without wttr.in - #21482
Merged
Merged
Conversation
Contributor
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; no actionable defects were found. SummaryKeeps weather units tied to the selected place when wttr.in fails.
No actionable issues found. Runtime tests and desktop checks were not run during this review.
|
* Keep weather units on the pinned location's country The panel picked metric or imperial from wttr.in's nearest_area country, and with coordinates configured only Open-Meteo answers the current conditions, which carries no country. A wttr.in failure therefore left reportCountry empty and the unit fell through to the session locale, so an Australian location read as °F on an en_US session until wttr.in came back. weather.json now carries the place's ISO 3166-1 country code: the panel stores the geocoder's country_code with the coordinates it pins, and geo.omarchy.org already answers with one, so an auto-detected place has it too. Units follow that code before wttr.in's report and the locale. Closes #17415 * Read the imperial countries by their country codes too countryUsesImperial knew Liberia and Myanmar by name only, so the codes weather.json now stores (LR, MM) fell through to metric. Both are listed alongside their names, with tests. Also spell out --country in the manual, which promised the units without showing how a CLI-pinned place gets one. * Respect LC_MEASUREMENT and LC_ALL for weather unit selection * Drop stale wttr.in country on location change and add weather unit tests When wttr.in fails after a location change, the previous location's cached wttr.in report could still supply areaInfo.country for the new location, flipping units if the new location carried no saved country. Track the query that produced the current wttr.in report so stale areaInfo never bleeds across location changes, reject unknown flags in omarchy-weather-location --set, and add a focused unit and CLI test matrix covering degraded provider combinations (geo.omarchy.org, Open-Meteo, wttr.in outages, saved country codes, and LC_MEASUREMENT). --------- Co-authored-by: Reese Royster <reeseroyster@pm.me> Co-authored-by: Mikhail Turov <groldster@gmail.com> (cherry picked from commit 322523c)
emirb
force-pushed
the
backport/21397-v4-6-0
branch
from
December 3, 2026 13:16
19a0479 to
a8845cc
Compare
Collaborator
|
Recommend: Hold — waiting for the maintainer to settle the classification. Codex High checked the release-branch diff and classified the Fahrenheit fallback in #17415 as a bug. DeepSeek V4.1 Flash at Pi’s default effort classified the backport as an enhancement. The patch matches #21397, including the |
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.
Problem
When
wttr.inreturns HTTP 500, the weather panel drops its country signal and falls back toen_USFahrenheit for users outside the United States. Users in Europe and Australia see52°Finstead of11°Ceven though Open-Meteo still serves current conditions.Fix
This is a clean cherry-pick of #21397 (
322523c112), already merged intoquattro. It saves the ISO 3166-1 country code fromgeo.omarchy.organd Open-Meteo geocoding, respectsLC_ALLandLC_MEASUREMENT, and drops stalewttr.inarea data across location switches.Scope and risk
Only the weather panel,
omarchy-weather-location,manual/10-notices.md, and the weather unit test file change. Existingweather.jsonfiles without acountryfield keep working. Undo by reverting this single commit onv4-6-0.Evidence
The cherry-pick applied onto
v4-6-0(68a637db9) with no conflicts and an identical diff to322523c112. All 29 cases intest/shell.d/weather-unit-test.shpass on the backport branch. The same diff was verified end to end in a KVM desktop VM on #21397 (Amsterdam underwttr.inHTTP 500 moved from52°F / 9 mphto11°C / 15 km/h).Not checked: a separate
v4-6-0VM image build, as the diff matches #21397 onquattro.Refs #21397, #17415
Built on #17443 (Reese Royster), #20224 (Mikhail Turov), and #21164 (Andreas Kraxner).