Weatherflow Tempest v0.1.0 WeatherflowTempest.Protocol
The Weatherflow Protocol has a lot of magic fields. This parses and converts them to make the returned objects more intelligible.
Byte-effecient arrays are unpacked into named fields based on the protocol docs published by Weathperflow.
The following field standardizations are made to all event types:
- “type” fields are removed.
- “evt” fields containing the raw un-parsed event data are removed
- “uptime” fields containing seconds-of-uptime are converted to human readable uptime strings
- “timestamp” field containing the epoch time are converted to DateTime All fields that are converted are named using atoms rather than strings, however fields that are not changed retain their string-based keys.
Link to this section Summary
Functions
Accepts the result tuple of Jason.decode() If the JSON could not be decoded bubble the error up to be handled by the client. Otherwise parse the event types defined by the Weatherflow spec
Link to this section Functions
Accepts the result tuple of Jason.decode() If the JSON could not be decoded bubble the error up to be handled by the client. Otherwise parse the event types defined by the Weatherflow spec.
Returns a tuple containing an atom matching the event “type” field, followed by the parsed object as a map.