kopia lustrzana https://github.com/glidernet/python-ogn-client
Fixed inReach parser
rodzic
b8f0028f1e
commit
7682a69fd7
|
@ -14,5 +14,5 @@ class InreachParser(BaseParser):
|
|||
ac_match = self.position_pattern.match(aprs_comment)
|
||||
return {'address': ac_match.group('id'),
|
||||
'model': ac_match.group('model') if ac_match.group('model') else None,
|
||||
'status': ac_match.group('status') == True if ac_match.group('status') else None,
|
||||
'status': ac_match.group('status') == 'True' if ac_match.group('status') else None,
|
||||
'pilot_name': ac_match.group('pilot_name') if ac_match.group('pilot_name') else None}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import unittest
|
||||
|
||||
from ogn.parser.aprs_comment.generic_parser import GenericParser
|
||||
|
||||
|
||||
class TestStringMethods(unittest.TestCase):
|
||||
def test_position_comment(self):
|
||||
message = GenericParser().parse_position("id0123456789 weather is good, climbing with 123fpm")
|
||||
self.assertTrue('comment' in message)
|
||||
|
||||
message = GenericParser().parse_status("id0123456789 weather is good, climbing with 123fpm")
|
||||
self.assertTrue('comment' in message)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
|
@ -0,0 +1,4 @@
|
|||
# The following beacons are example for INREACH APRS format
|
||||
# source: https://github.com/glidernet/ogn-aprs-protocol
|
||||
#
|
||||
OGN8A0749>OGINREACH,qAS,INREACH:/142700h0448.38N/07600.74W'000/000/A=004583 id300434060496190 inReac True
|
Ładowanie…
Reference in New Issue