Expand description
§A parser definition for weatherflow/tempest json records.
This library is the result of expanding a simple UDP packet
monitor written to help diagnose connection issues with a
WeatherFlow
Tempest weather station. UDP packets from the
hub contain JSON formatted strings. The same JSON format
is used in the results from the cloud REST API.
All fields are specified as public to enable this library to be used as a connector for other services.
§Example
use libtempest::Tempest;
use serde_json;
let buf = r#"
{
"serial_number": "SK-00008453",
"type":"evt_precip",
"hub_sn": "HB-00000001",
"evt":[1493322445]
}"#;
let rec: Tempest = serde_json::from_str(&buf).unwrap();
if let Tempest::EvtPrecip(x) = &rec {
println!("{:?}", x);
println!("{:?}", x.serial_number);
println!("{:?}", x.evt);
println!("{:?}", x.evt.epoch);
}
§References
Structs§
- Device
Status - Structure defining the [Device Status] enum varient.
- EvtPrecip
- Structure defining the [Rain Start Event] enum varient.
- EvtPrecip
Evt - Precipitation event detail.
- EvtStrike
- Structure defining the [Lightning Strike] enum varient.
- EvtStrike
Evt - Lightning strike event detail.
- HubStatus
- Structure defining the [Hub Status] enum varient.
- ObsAir
- Structure defining the [Air Observation] enum varient.
- ObsAir
Obs - Air Observation detail.
- ObsSky
- Structure defining the [Sky Observation] enum varient.
- ObsSky
Obs - Sky Observation detail.
- ObsSt
- Structure defining the [Tempest Observation] enum varient
- ObsSt
Obs - Tempest Observation detail.
- Radio
Stats - Radio Stats detail.
- Rapid
Wind - Structure defining the [Rapid Wind] enum varient.
- Rapid
Wind Ob - Rapid Wind event detail.
Enums§
- Tempest
- Top level abstraction using serde tag feature to select
enum varient based on the value of the JSON
type
field.