Skip to content

Commit

Permalink
Add heave type
Browse files Browse the repository at this point in the history
Signed-off-by: Joep de Jong <[email protected]>
  • Loading branch information
JoepdeJong committed Apr 18, 2024
1 parent 2f1a9d9 commit eb2617b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions pynmea2/types/talker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,3 +1098,11 @@ class LAA(TalkerSentence):
("ClimbRate","ClimbRate"),
("Type","Type"),
)

# Implemented by Joep de Jong
# GPHEV: Heave
class HEV(TalkerSentence):
"""
Heave
"""
fields = (("Heave", "heave", float),)
12 changes: 11 additions & 1 deletion test/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,14 @@ def test_ALR():
assert msg.alarm_num == '006'
assert msg.alarm_con == 'V'
assert msg.alarm_state == 'V'
assert msg.description == 'AIS:general failure'
assert msg.description == 'AIS:general failure'


def test_HEV():
data = "$GPHEV,-0.01*52"
msg = pynmea2.parse(data)
assert msg.render() == data
assert isinstance(msg, pynmea2.HEV)
assert msg.talker == "GP"
assert msg.sentence_type == "HEV"
assert msg.heave == -0.01

0 comments on commit eb2617b

Please sign in to comment.