Skip to content

Temperatures in °F or °C: Automatic follows the household's country, or Settings says - #5

Open
pathik-vyas wants to merge 7 commits into
rileysheehan:mainfrom
pathik-vyas:celsius-setting
Open

pathik-vyas wants to merge 7 commits into
rileysheehan:mainfrom
pathik-vyas:celsius-setting

Conversation

@pathik-vyas

Copy link
Copy Markdown

Hi Riley, thank you for Gingham. It's lovely on the wall. I'd like the weather in Celsius, and there was no way to change it, so this adds one.

What it does

A new Temperature setting in the frame's Settings, under Appearance, next to Clock: Automatic / °F / °C.

  • It works like the Clock setting. On Automatic it follows the country of the place picked on the setup page: Fahrenheit in the US and the few places that use it (BS, BZ, KY, LR, PW, FM, MH), Celsius everywhere else.
  • A household whose country isn't known yet stays on Fahrenheit, so nothing changes for anyone until they pick a place or a unit.
  • Every temperature on the wall follows it: now, H/L, feels-like, the week's forecast and tomorrow's evening row (including the aria labels).

How

  • The server still asks Open-Meteo in Fahrenheit, so the weather cache, the fixtures and the design-review screens are unchanged. The wall converts as it draws, through one small deg() helper in dist/app.js.
  • The feels-like note keeps the same threshold: 4 °F, or 2 °C.
  • settings.js accepts temperature: 'auto' | 'F' | 'C', defaulting to 'auto'. Anything else is ignored, like the other settings.
  • README mentions it, next to text size.

Tests

  • test/settings.test.js: the setting's default, accepted values and persistence.
  • test/wall.test.js: US and unknown-country households stay in °F, a GB household is in °C everywhere on the wall, Settings overrides the country both ways, and the three choices appear.
  • test/updates-server.test.js: added temperature to the 0.1.0 upgrade test, as with the earlier settings.

npm run check && npm test passes: 212 tests.

Happy to change anything, such as the labels, where it sits in Settings, or the country list.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QMXEQa7MreWUVb5BaDr9s9

This branch has not been deployed

No deployments
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