From 27b22c527c2a566d81f552c0bae616d15a0ddaa5 Mon Sep 17 00:00:00 2001 From: Wolfgang Haupt Date: Thu, 12 Jan 2023 11:23:13 +0100 Subject: [PATCH] Add support for MTA sentence --- pynmea2/types/talker.py | 13 +++++++------ test/test_types.py | 12 +++++++++++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/pynmea2/types/talker.py b/pynmea2/types/talker.py index 55e9cb6..54d7ecb 100644 --- a/pynmea2/types/talker.py +++ b/pynmea2/types/talker.py @@ -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 @@ -885,12 +892,6 @@ class TTM(TalkerSentence): # fields = ( # ) -#class MTA(TalkerSentence): -# """ Air Temperature (to be phased out) -# """ - # fields = ( - # ) - #class OLN(TalkerSentence): # """ Omega Lane Numbers # """ diff --git a/test/test_types.py b/test/test_types.py index b37e2f9..d72e99d 100644 --- a/test/test_types.py +++ b/test/test_types.py @@ -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 \ No newline at end of file + 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'