Skip to content

feat: AI advice card, air quality (AQI) card, and debug APK workflow - #25

Closed
HmnDev-Tech wants to merge 3 commits into
sameerasw:mainfrom
HmnDev-Tech:main
Closed

HmnDev-Tech wants to merge 3 commits into
sameerasw:mainfrom
HmnDev-Tech:main

Conversation

@HmnDev-Tech

@HmnDev-Tech HmnDev-Tech commented Oct 15, 2026 •

Copy link
Copy Markdown

Summary

Adds two new cards to the main weather screen and a settings section to configure them.

AI advice card (What to wear today)

  • New card on the main screen sends a compact summary of the current weather (temperature, feels like, humidity, wind, rain chance, high/low, active alerts) to an LLM and renders short advice: what to wear, whether to take an umbrella, best time to go outside, one health tip.
  • Default model: gemini-3.5-flash-lite via the Google AI Studio API (generativelanguage.googleapis.com), keyed for low volume and fast responses.
  • The API key is entered in Settings -> AI advice and stored on-device only (same pattern as weather provider keys).
  • Provider selection between cloud providers:
    • Gemini (AI Studio) - native generateContent endpoint, key link in settings.
    • OpenAI - OpenAI-compatible /chat/completions, custom model + base URL.
    • OpenRouter - OpenAI-compatible, custom model + base URL.
  • Model name and base URL are editable per provider; sensible defaults are pre-filled.
  • Card states handled: no key (button straight to settings), loading, error with message, cached advice with refresh button.

Air quality (AQI) card

  • New standalone card fetching live data from Open-Meteo Air Quality API (no API key needed): US AQI, PM2.5, PM10, O3, NO2.
  • Category label with color coding: Good / Moderate / Unhealthy for sensitive groups / Unhealthy / Very unhealthy / Hazardous.
  • Uses the same location resolution as weather (manual location first, then device location).
  • Manual refresh button; shows the data source in the card footer.

Files changed

  • weather/ai/AiProviders.kt, weather/ai/AiAdvisor.kt - provider registry and Gemini/OpenAI-compatible client (HTTP through the existing ProviderHttp).
  • weather/aqi/AqiRepository.kt - Open-Meteo air quality fetch + category mapping.
  • ui/features/weather/AiAdviceCard.kt, ui/features/weather/AqiCard.kt - the two new cards.
  • ui/features/weather/AiSettingsUI.kt - new settings section, mounted in SettingsActivity.
  • ui/features/weather/WeatherDetailSheet.kt - cards inserted in both the portrait and wide/two-pane layouts.
  • data/repository/SettingsRepository.kt - AI provider/model/base URL/key storage.
  • �pp/build.gradle.kts - optional
  • es/values/strings.xml - new strings.

Notes for maintainers

  • AI requests and the API key never leave the device except the request itself to the selected provider; nothing is logged.
  • The workflow artifact is signed with the runner-generated debug key, so cross-run upgrade installs require the signing secrets above.
  • Strings are English-only (matching the existing �alues/strings.xml); happy to add translations if there is a localization flow.

@HmnDev-Tech

Copy link
Copy Markdown
Author

Superseding with a PR that contains only the feature changes (no CI workflow files).

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