Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unroll proposed weather packet parsing fixes for PR#81 (Issue rossengeorgiev#80). Course and Speed are ignored by parse_data_extentions() by when either value is '000'. I.e. 000/000 is considered not relevent an is ignored. When either value is 000, course or speed is set to None. It is possible for a weather report to have a speed of 0, meaning no wind. This should still be captured as it's relevent for a weather report. Course can also be 0, since some weather stations will report 0 for direction when speed is also 0. The core of the issue is that parse_data_extentions() ignores course and speed as noted above, AND it trims the course/speed from the body string. parse_weather_data() still looks to parse course/speed, but cannot when it's been removed by parse_data_extentions(). This change duplicates the contents of "body" so both parse_data_extentions() and parse_weather_data(body) have the appropriate body to parse.
- Loading branch information