mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-06-10 17:04:45 +02:00
nws: multi-line wire format with SAME emoji, NWS office, hazard/impact/instruction
Replace single-line _render() with structured 6-line format: L1: SAME emoji + event type + NWS office (from WMO identifier) L2: area (first areaDesc segment, max 60 chars) L3: hazard (from HAZARD.../TORNADO... or maxWindGust/maxHailSize params) L4: impact (from IMPACT... in description) L5: expires L6: instruction (max 80 chars) Add module-level helpers: _SAME_EMOJI, _NWS_OFFICE_SHORT, _nws_office(), _parse_nws_description(). Emoji prefers SAME event code, falls back to _emoji_for_event() substring match. All _render() call sites pass d=d. Update test to match new format (coordinates removed from wire). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
15c414f255
commit
b3105c65f5
2 changed files with 100 additions and 13 deletions
|
|
@ -194,8 +194,9 @@ def test_commit_callback_updates_last_broadcast(mem_db):
|
|||
assert el["handled"] == 1
|
||||
|
||||
|
||||
def test_wire_includes_coords_and_expires(mem_db):
|
||||
def test_wire_includes_event_area_and_expires(mem_db):
|
||||
env = _nws_env(severity_str="Severe", lat=42.500, lon=-114.460)
|
||||
wire = handle_nws(env, env["subject"], data={}, now=1_000_000)
|
||||
assert "@ 42.500,-114.460" in wire
|
||||
assert "Severe Thunderstorm Warning" in wire
|
||||
assert "Twin Falls County" in wire
|
||||
assert "until" in wire.lower()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue