Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
## [Unreleased]

### Added
- You can now choose "Use my current location" when adding or updating a saved location. AccessiWeather asks the OS once, only after you press the button, and keeps manual search available if location access is denied or unavailable.
- Alert updates can now use their own mappable sound in sound packs.
- Settings > Audio can now enable specific-alert sounds per sound pack, so packs with sounds like `tornado_watch` and `tornado_warning` keep working while severity-only packs stay simple.
- First-run setup can now import existing settings and encrypted API keys from the wizard, or exit with Escape at any wizard step when you want to configure everything yourself.
Expand All @@ -20,6 +21,7 @@ All notable changes to this project will be documented in this file.
- Alert sounds and sound-pack creation now focus on alert severity instead of a long list of specific alert names, while existing packs can keep their older mappings.

### Fixed
- Editing a location after using "Use my current location" now refreshes the editable name and saved US metadata for the detected point, so locations don't quietly fall back to metric defaults.
- Notification sounds now recover after Windows sleep or hibernation, so update
notifications don't fall back to only the generic Windows toast sound.
- Plain Language Summary now shows and speaks which OpenRouter model it is trying, when it falls back from a busy free model, and why the final model was used.
Expand Down
4 changes: 4 additions & 0 deletions installer/build_nuitka.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ def build_nuitka_command(
[
f"--macos-app-name={APP_NAME}",
f"--macos-app-icon={_repo_path(icon)}",
"--macos-app-protected-resource="
"NSLocationWhenInUseUsageDescription:"
"AccessiWeather uses your location only when you choose Use my current location "
"to add or edit a saved weather location.",
]
)
elif system == "Linux":
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ dependencies = [
"tzdata",
"cryptography>=42.0.0",
"Unidecode>=1.3.8",
"winsdk; sys_platform == 'win32'",
"pyobjc-framework-CoreLocation; sys_platform == 'darwin'",
]
readme = "README.md"
classifiers = [
Expand Down
2 changes: 2 additions & 0 deletions src/accessiweather/config/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ def update_location_details(
longitude: float,
country_code: str | None,
marine_mode: bool,
display_name: str | None = None,
) -> bool:
"""Update editable details on an existing location."""
return self._locations.update_location_details(
Expand All @@ -311,6 +312,7 @@ def update_location_details(
longitude=longitude,
country_code=country_code,
marine_mode=marine_mode,
display_name=display_name,
)

def remove_location(self, name: str) -> bool:
Expand Down
27 changes: 21 additions & 6 deletions src/accessiweather/config/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,24 @@ def update_location_details(
longitude: float,
country_code: str | None,
marine_mode: bool,
display_name: str | None = None,
) -> bool:
"""
Update editable details on an existing location and persist them.

The location name is intentionally stable. When coordinates change,
cached NWS metadata is cleared so the next refresh resolves zones for
the new point instead of reusing the old city/ZIP point.
When coordinates change, cached NWS metadata is cleared so the next
refresh resolves zones for the new point instead of reusing the old
city/ZIP point.
"""
config = self._manager.get_config()
new_name = (display_name or name).strip()
if not new_name:
self.logger.warning("Location %s update rejected: empty display name", name)
return False

if new_name != name and any(location.name == new_name for location in config.locations):
self.logger.warning("Location %s update rejected: %s already exists", name, new_name)
return False

for location in config.locations:
if location.name != name:
Expand All @@ -225,7 +234,10 @@ def update_location_details(
isclose(location.latitude, latitude, abs_tol=1e-6)
and isclose(location.longitude, longitude, abs_tol=1e-6)
)
current = config.current_location
current_matches_location = current is not None and current.name == name

location.name = new_name
location.latitude = latitude
location.longitude = longitude
location.country_code = country_code
Expand All @@ -239,13 +251,16 @@ def update_location_details(
location.fire_zone_id = None
location.radar_station = None

current = config.current_location
if current is not None and current.name == name:
if current_matches_location:
config.current_location = location

if new_name != name:
self._sort_locations(config)

self.logger.info(
"Updated location details for %s%s",
"Updated location details for %s%s%s",
name,
f" as {new_name}" if new_name != name else "",
" and cleared zone metadata" if coordinates_changed else "",
)
return self._manager.save_config()
Expand Down
Loading