Skip to content

Commit

Permalink
Add support for MTA sentence (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
a1rwulf authored Nov 22, 2024
1 parent f298742 commit d9eb144
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
13 changes: 7 additions & 6 deletions pynmea2/types/talker.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,13 @@ def localdatetime(self):
return d.astimezone(self.tzinfo)


class MTA(TalkerSentence):
""" Air Temperature (to be phased out)
"""
fields = (
("Air temperature", "temperature", Decimal),
("Units of measurement", "units"),
)


# Implemented by Janez Stupar for Visionect
Expand Down Expand Up @@ -885,12 +892,6 @@ class TTM(TalkerSentence):
# fields = (
# )

#class MTA(TalkerSentence):
# """ Air Temperature (to be phased out)
# """
# fields = (
# )

#class OLN(TalkerSentence):
# """ Omega Lane Numbers
# """
Expand Down
12 changes: 11 additions & 1 deletion test/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,4 +340,14 @@ def test_HEV():
assert isinstance(msg, pynmea2.HEV)
assert msg.talker == "GP"
assert msg.sentence_type == "HEV"
assert msg.heave == -0.01
assert msg.heave == -0.01


def test_MTA():
data = "$WIMTA,010.0,C*2A"
msg = pynmea2.parse(data)
assert msg.render() == data
assert msg.talker == 'WI'
assert msg.sentence_type == 'MTA'
assert msg.temperature == 10.0
assert msg.units == 'C'

0 comments on commit d9eb144

Please sign in to comment.