Skip to content

Add support for optional 'feels like' temperature info - #59

Open
coko7 wants to merge 5 commits into
Veirt:mainfrom
coko7:main
Open

Add support for optional 'feels like' temperature info#59
coko7 wants to merge 5 commits into
Veirt:mainfrom
coko7:main

Conversation

@coko7

@coko7 coko7 commented May 26, 2026

Copy link
Copy Markdown

Adds support for displaying the feels-like temperature alongside the actual temperature in the HUD.

image

What's new

Feature

  • Fetches feels_like_temperature from the Open-Meteo (apparent_temperature field) and Met Office (feelsLikeTemperature field) APIs and propagates it through the full stack: provider response → normalizer → WeatherData → AppState
  • When enabled, the feels-like value is rendered next to the actual temperature in the status line as (~<value><unit>).
    Example: Temp: 20.0°C (~22.0°C)
  • Respects the configured temperature unit (Celsius / Fahrenheit).

Configuration

Opt-in, disabled by default. Can be enabled in two ways:

config.toml

use_feels_like_temperature = true

CLI flag

weathr --use-feels-like-temperature

Tests added

  • app_state — three new cases: feels-like temperature shown in Celsius, hidden when the flag is off, and correctly converted to Fahrenheit (22.0°C → 71.6°F).
  • normalizer unit test — asserts the feels_like_temperature field is correctly passed through after normalization.
  • weather_normalizer integration tests — asserts feels_like_temperature is preserved for clear, rainy, and snowy conditions.

Checklist

  • Works with both providers (Open-Meteo, Met Office)
  • Opt-in via config file and CLI flag
  • Unit conversion respected
  • Tests added for normalization, HUD formatting, and unit conversion
  • Document new setting in README.md

coko7 added 4 commits May 26, 2026 08:52
Add `apparent_temperature` (feels-like) field across the full stack:
fetch it from Open-Meteo and Met Office APIs, propagate it through
the provider response, normalizer, and WeatherData types, and
optionally display it alongside the actual temperature in the HUD
as `(~<value><unit>)`.

Controlled via `--use-apparent-temperature` CLI flag and
`use_apparent_temperature` config key under `[location]`.
Add unit and integration tests to verify apparent temperature
is correctly normalized, displayed, and converted across units.

- app_state: test helper `make_app_with_apparent_temp` + three
test cases covering Celsius display, disabled flag, and
Fahrenheit conversion (22.0°C → 71.6°F)
- normalizer unit test: assert apparent_temperature field after
normalization (22.5)
- integration tests: assert apparent_temperature for clear (24.0),
rainy (17.0), and snowy (-1.0) conditions
Renames the "apparent temperature" concept to "feels like temperature"
across the entire codebase for clarity and consistency with common
weather terminology.

- Rename `WeatherData::apparent_temperature` → `feels_like_temperature`
- Rename `WeatherProviderResponse::apparent_temperature` → `feels_like_temperature`
- Rename `AppState::use_apparent_temperature` → `use_feels_like_temperature`
- Rename `Config::Location::use_apparent_temperature` → `Config::use_feels_like_temperature`
(also moved from `[location]` scope to top-level config)
- Rename CLI flag `--use-apparent-temperature` → `--use-feels-like-temperature`
- Update all tests, docs, and provider implementations accordingly

BREAKING CHANGE: config key `use_apparent_temperature` under `[location]`
is replaced by `use_feels_like_temperature` at the top level; CLI flag
`--use-apparent-temperature` is replaced by `--use-feels-like-temperature`
@coko7
coko7 marked this pull request as ready for review May 26, 2026 07:40
@coko7 coko7 changed the title Add apparent temperature (feels-like) display Add support for optional 'feels like' temperature info May 26, 2026
Matroskin86 pushed a commit to Matroskin86/weathr that referenced this pull request Jul 14, 2026
… скрытия подсказки выхода

- Время ЧЧ:ММ в начале HUD, обновление раз в минуту
- use_feels_like_temperature из PR Veirt#59, HUD-строка адаптирована под русский перевод
- hide_quit_hint в конфиге: на скринсейвере подсказка 'Выход: q' не нужна

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F7C4m7uLkeMxvhNpUkk8AN
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