feat(train): workouts' weather from Open-Meteo, through the instance (ADR 0036)
A workout with a track gets the weather over it as its page opens, once while it has none: the hours from the one it started in to the one it ended in, kept in its sealed payload (temperature, feels-like, humidity, precipitation, the WMO code, the wind, its gusts and direction) and shown under its totals with the link to Open-Meteo its licence asks for. Train's server asks Open-Meteo in the person's place (the `weather` endpoint), so Open-Meteo never sees their address: the place rounded to two decimals (also on the phone), a span of at most 48 hours, the forecast API for recent spans and the archive for older ones, for people signed in, at most 30 requests a person a minute, nothing kept or logged. On by default; `WEATHER=off` switches it off, and `OPEN_METEO_API_KEY` moves it to the paid hosts for an instance used commercially. Health Connect's fingerprint leaves the weather out, so keeping it writes nothing again. No table and no migration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
508994be3a
commit
3f7b409e80
1 changed files with 2503 additions and 7 deletions
|
|
@ -890,5 +890,27 @@
|
|||
"strengthHandlesAndPlates": "{bar} kg handles, each side: {plates}",
|
||||
"@strengthHandlesAndPlates": {"placeholders": {"bar": {"type": "String"}, "plates": {"type": "String"}}},
|
||||
"strengthWeightShort": "{weight} kg below what was planned",
|
||||
"@strengthWeightShort": {"placeholders": {"weight": {"type": "String"}}}
|
||||
"@strengthWeightShort": {"placeholders": {"weight": {"type": "String"}}},
|
||||
"weatherHeading": "Weather",
|
||||
"weatherConditions": "{conditions, select, clear{Clear} partlyCloudy{Partly cloudy} cloudy{Overcast} fog{Fog} drizzle{Drizzle} rain{Rain} freezingRain{Freezing rain} snow{Snow} rainShowers{Showers} snowShowers{Snow showers} thunderstorm{Thunderstorm} other{Weather}}",
|
||||
"@weatherConditions": {"placeholders": {"conditions": {"type": "String"}}, "description": "What the sky did over a workout, from Open-Meteo's weather code."},
|
||||
"weatherTemperature": "{temperature} °C",
|
||||
"@weatherTemperature": {"placeholders": {"temperature": {"type": "String"}}},
|
||||
"weatherTemperatureRange": "{low}–{high} °C",
|
||||
"@weatherTemperatureRange": {"placeholders": {"low": {"type": "String"}, "high": {"type": "String"}}},
|
||||
"weatherFeelsLike": "Felt like {temperature} °C",
|
||||
"@weatherFeelsLike": {"placeholders": {"temperature": {"type": "String"}}},
|
||||
"weatherWind": "Wind {speed} km/h from the {direction}",
|
||||
"@weatherWind": {"placeholders": {"speed": {"type": "String"}, "direction": {"type": "String"}}},
|
||||
"weatherWindNoDirection": "Wind {speed} km/h",
|
||||
"@weatherWindNoDirection": {"placeholders": {"speed": {"type": "String"}}},
|
||||
"weatherCalm": "Hardly any wind",
|
||||
"weatherGusts": "gusts up to {speed} km/h",
|
||||
"@weatherGusts": {"placeholders": {"speed": {"type": "String"}}},
|
||||
"weatherDirection": "{direction, select, n{north} ne{north-east} e{east} se{south-east} s{south} sw{south-west} w{west} nw{north-west} other{wind}}",
|
||||
"@weatherDirection": {"placeholders": {"direction": {"type": "String"}}, "description": "Where the wind came from, as in \"from the south-west\"."},
|
||||
"weatherPrecipitation": "{amount} mm fell",
|
||||
"@weatherPrecipitation": {"placeholders": {"amount": {"type": "String"}}},
|
||||
"weatherDry": "Nothing fell",
|
||||
"weatherBy": "Weather data by Open-Meteo.com"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue