Skip to content

feat: Auto unit preference based on location country (#487)#490

Merged
Orinks merged 3 commits intodevfrom
eli/issue-487-auto-units
Mar 19, 2026
Merged

feat: Auto unit preference based on location country (#487)#490
Orinks merged 3 commits intodevfrom
eli/issue-487-auto-units

Conversation

@Orinks
Copy link
Owner

@Orinks Orinks commented Mar 19, 2026

Summary

Adds an 'Auto (based on location)' option to the temperature/unit preference that automatically selects the appropriate unit system based on the location's country.

Changes

  • New 'Auto' option in temperature unit dropdown
  • Country detection via location's country_code field
  • Unit mapping: US→°F/mph/miles, GB→°C/mph/miles, CA→°C/km-h/km, default→°C/m/s/km
  • PW client uses matching unit system per location
  • New unit_utils.py with country-to-unit resolution logic
  • Display layer resolves effective unit preference per-location
  • Tests for unit resolution and display

Closes #487

Orinks and others added 3 commits March 19, 2026 01:34
- Add 'Auto (based on location)' option to temperature unit setting
- Detect country from location coordinates via country_code field
- Unit mapping: US→°F/mph, GB→°C/mph, CA→°C/km-h, default→°C/m-s
- PW client uses matching unit system per location
- New unit_utils.py with country-to-unit resolution
- Display layer resolves effective unit preference per-location
@Orinks Orinks merged commit c9935fe into dev Mar 19, 2026
3 checks passed
@Orinks Orinks deleted the eli/issue-487-auto-units branch March 19, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant