pretrip_source_jma 0.2.1
pretrip_source_jma: ^0.2.1 copied to clipboard
Japan Meteorological Agency (AMeDAS) measured-visibility source for the pretrip_decision_advisor pre-trip "Before you drive" briefing. Emits a real surface-visibility observation (metres) the advisor [...]
Changelog #
0.2.1 #
-
Widen the
pretrip_decision_advisorconstraint to'>=0.5.0 <0.7.0'so this package resolves againstpretrip_decision_advisor0.6.0 (which addsHourHazard.unknown— a trip with NO forecast no longer reports its peak hazard asclear). This package'slib/reads neither changed symbol, so 0.6.0 is source-compatible; for a 0.x package a caret does not admit the next minor, so without the widen^0.5.0and 0.6.0 have an EMPTY intersection. -
Take pretrip_decision_advisor ^0.5.0. The previous
^0.4.0pin silently excluded the 0.5.x line — hosted consumers of this adapter never received the black-ice window and route-corridor bridge-icing pre-trip warnings (橋は路面より先に凍結します) shipped there. No behavior change in this package itself; the constraint widening is the release.
0.2.0 — 2026-06-24 — Re-pin advisor to ^0.4.0 (catalog resolvability) #
- Shifts the
pretrip_decision_advisorrequirement from the 0.2.x range to the 0.4.x range; advisor 0.2.x/0.3.x are no longer supported by this version. This package's own public API is unchanged. Minor bump because the resolution requirement is consumer-affecting. - The published
pretrip_decision_advisor0.4.0 is live on pub.dev; the original^0.2.0constraint was incompatible with it and blocked edge developers frompub add-ing this source together with the current advisor in a single project. - The
VisibilityObservationmeasurement contract this package re-exports is unchanged across advisor 0.2.0 → 0.4.0.
0.1.0 — 2026-06-14 — Initial scaffold #
- Initial release of the Japan Meteorological Agency (AMeDAS)
measured-visibility source for the
pretrip_decision_advisorpre-trip "Before you drive" briefing. JmaVisibilityProviderfetches the nearest fresh surface-visibility reading (metres) from the JMA AMeDAS open-data network around a requested point: it readslatest_time.txtfor the snapshot timestamp, theamedastable.jsonstation table for nearest-station geometry, and the map snapshot for the visibility sensor value — accepting a value only when its QC flag is 0 (normal) and the snapshot is newer thanmaxObservationAge.- Emits the source-neutral
VisibilityObservation(re-exported frompretrip_decision_advisor) — the same typed measurement the Finnish Digitraffic source emits — so the advisor'smergeObservedVisibilitymerge logic lives once, not per source. - Honesty rules (binding): visibility is NEVER estimated; a warning NEVER
produces a number; an observation is valid for the departure hour ONLY;
any non-normal QC flag, no station in range, no fresh visibility, or any
fetch failure →
null(the driver's own judgement, never a fabricated hazard). HTTP/parse failures throwJmaVisibilityException. - Extracted verbatim from the SNGNav app provider; the
VisibilityObservation/mergeObservedVisibilitymeasurement contract is owned by the publishedpretrip_decision_advisor0.2.0 package, resolved from pub.dev (no app-relative imports). - Measurement-vs-warning sibling:
condition_aggregator_jma(same upstream JMA provider) emits a WARNING (Advisory); this package emits a MEASUREMENT (VisibilityObservation). - License + attribution: package code BSD-3-Clause; the data is 気象庁 / Japan Meteorological Agency open data — the integrator surfaces the attribution at the consumer-facing HMI.
- Tests: 7 mocked-HTTP cases via
package:http/testing.dartMockClient(nearest fresh QC-0 reading served; no-visibility-sensor station skipped; non-zero QC flag rejected; stale snapshot discarded; no-station-in-range → null; non-200 →JmaVisibilityException; plus an end-to-end case proving a measured 80 m Akita reading lights the advisor's whiteout/severe band the forecast alone never reaches).