fix(starlark): blank app locations use the device location, not San Francisco

A Starlark (Tidbyt) app whose Location field is blank rendered at its
author's hard-coded DEFAULT_LOCATION -- usually San Francisco -- even with
the device city set under General settings. A user in Charlotte, NC got San
Francisco weather and radar with nothing in config.json to explain it.

src/device_location.py fills unset location fields at render time (display
plugin and the web standalone render): the device city is geocoded once via
Open-Meteo, preferring a match in the configured state/country, and cached
permanently. A saved location always wins; if the lookup fails the field is
dropped so the app uses its own default, and the failure is not retried for
30 minutes.

Also fixes the config form: clearing a location omitted the key, and the
save merges, so the old value could never be removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-09-23 11:32:41 -04:00
co-authored by Claude Opus 5.5
parent e1ce7189f1
commit b076313392
9 changed files with 758 additions and 6 deletions
+6 -2
View File
@@ -127,7 +127,7 @@ Verify installation:
3. Filter by category: Weather, Sports, Finance, Games, Clocks, etc.
4. Click **Install** on desired apps
5. Configure each app:
- Set location/timezone
- Set location/timezone (optional: blank uses this device's location)
- Enter API keys if required
- Customize display preferences
@@ -137,7 +137,11 @@ Each app may have different configuration options:
#### Common Configuration Types
- **Location** (lat/lng/timezone): For weather, clocks, transit
- **Location** (lat/lng/timezone): For weather, clocks, transit. Left blank,
the app renders at this device's location (City / State / Country under
General settings). Without that, most community apps fall back to their
author's hard-coded default, usually San Francisco. Fill it in only to
point one app somewhere else.
- **API Keys**: For services like weather, stocks, sports scores
- **Display Preferences**: Colors, units, layouts
- **Dropdown Options**: Team selections, language, themes