Skip to content

Commit

Permalink
Merge pull request #1 from andrewgryan/bug/encode-fm
Browse files Browse the repository at this point in the history
Fix FMDDMMHH encoding
  • Loading branch information
andrewgryan authored Nov 15, 2024
2 parents 3ac7eba + 6cadffb commit 9be4160
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/detaf/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ def taf_encode(self):
parts = []
if self.probability:
parts.append(f"PROB{self.probability:02}")
if self.fm:
parts.append(self.fm.taf_encode())
if self.change:
parts.append(self.change.value)
if self.period:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_invariants.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_encode_decoded_report(modification, icao_identifier):
report = f"TAF"
report += f" {modification.value}"
report += f" {icao_identifier}"
report += " 000000Z 0000/0000 9999 PROB30 TEMPO 0000/0000 9999"
report += " 000000Z 0000/0000 9999 PROB30 TEMPO 0000/0000 9999 FM000000 5000"
assert detaf.encode(detaf.decode(report)) == report


Expand Down

0 comments on commit 9be4160

Please sign in to comment.