Fixing callsign updates in RDS.
This commit is contained in:
parent
a1000a4432
commit
71f35c8a4d
|
|
@ -131,8 +131,13 @@ class RdsParser(TextParser):
|
|||
# Expect JSON data in text form
|
||||
data = json.loads(msg)
|
||||
# Delete constantly changing group ID
|
||||
if "group" in data:
|
||||
del data["group"]
|
||||
data.pop("group", None)
|
||||
# Treat uncertain callsigns as normal
|
||||
if "callsign_uncertain" in data:
|
||||
data["callsign"] = data.pop("callsign_uncertain")
|
||||
# Clear callsign if PI changes
|
||||
if data.get("pi") != self.rds.get("pi"):
|
||||
self.rds.pop("callsign", None)
|
||||
# Only update if there is new data
|
||||
if data.items() <= self.rds.items():
|
||||
return None
|
||||
|
|
|
|||
Loading…
Reference in New Issue