@pierre-gilles , tu pourras regarder de ton côté dans l’intégration externe openweather le retour des alertes.
Dans l’image ci-dessous, OpenWeather à gauche et Meteo France à droite.
OpenWeather envoie des informations erronées, est-ce l’intégration ou les données envoyées par openWeather ?
Et le texte des alertes est en anglais et dupliqué autant de fois qu’il y a d’alertes
Merci pour le retour, j’ai corrigé tout ça ici :
main ← claude/openweather-integration-ohl3uo
ouvert 01:21PM - 10 Aug 26 UTC
## Summary
Enhanced the weather alert processing to correctly parse alert severi… ty from vigilance colours, deduplicate repeated bulletins, filter expired alerts, and improve phenomenon type detection across French and English wordings.
## Key Changes
- **Severity parsing by colour:** Added `SEVERITY_BY_COLOUR` to read the vigilance colour (red/orange/yellow) before generic severity keywords. This is critical for MeteoAlarm alerts where every alert is called a "warning" — the colour is the actual severity level published by the office.
- **Phenomenon label stripping:** Created `severityWording()` function that removes phenomenon labels (both from OpenWeather tags and the `PHENOMENON_LABELS` list) before ranking severity. This prevents "Extreme high temperature" (a phenomenon name) from incorrectly elevating a yellow alert to extreme.
- **Bulletin deduplication:**
- Added `toDescription()` to clean up bulletin text by removing duplicate paragraphs
- Added `descriptionKey()` to normalize text for comparison (handles re-wrapping by relays)
- Track seen descriptions to avoid publishing the same bulletin text multiple times across related alerts
- **Expired alert filtering:** Added `isOngoing()` function to drop alerts past their `end` date. OpenWeather continues serving bulletins well after expiration, which would waste the 10-alert limit.
- **Duplicate alert detection:** Track alert identity (severity + type + event + start + end) to drop identical alerts sent multiple times.
- **Expanded pattern matching:** Enhanced regex patterns for phenomenon detection to cover more French and English variations:
- SNOW: added "freezing", "icy", "glace"
- COLD: added "gel", "gelée", "givre"
- FOG: added "brume"
- WIND: added "tornad", "cyclone", "typhoon", "tropical storm"
- FLOOD: added "ruissellement"
- **Test coverage:** Added comprehensive tests for colour-based severity, phenomenon label handling, bulletin deduplication, expired alert filtering, and duplicate detection.
- **Documentation updates:** Updated README and troubleshooting docs to explain alert language handling (OpenWeather serves alerts in English by default) and the importance of type detection for widget translation.
## Implementation Details
- The `formatAlerts()` function now accepts an optional `now` parameter for testability
- `formatOneCallWeather()` also accepts optional `now` parameter and passes it to `formatAlerts()`
- Test fixtures export `ONE_CALL_NOW` constant to ensure consistent alert expiration testing
- Regex escaping utility `escapeForRegExp()` added for safe dynamic pattern construction
https://claude.ai/code/session_013uqZyRZP4W7eKXKRKUDiBG