habitat.sensors.stdtelem¶
Sensor functions for dealing with telemetry.
Functions
coordinate(config, data) | Parses ASCII latitude or longitude into a decimal-degrees float. |
strptime((string, format) -> struct_time) | Parse a string to a time tuple according to a format specification. |
time(data) | Parse the time, validating it and returning the standard HH:MM:SS. |
- habitat.sensors.stdtelem.time(data)[source]¶
Parse the time, validating it and returning the standard HH:MM:SS.
Accepted formats include HH:MM:SS, HHMMSS, HH:MM and HHMM. It uses strptime to ensure the values are sane.
- habitat.sensors.stdtelem.coordinate(config, data)[source]¶
Parses ASCII latitude or longitude into a decimal-degrees float.
Either decimal degrees or degrees with decimal minutes are accepted (degrees, minutes and seconds are not currently supported).
The format is specified in config["format"] and can look like either dd.dddd or ddmm.mmmm, with one to three leading d characters and one to six trailing d or m characters.