From 4a4010ad7b1664f23b3f45659b53b6daae554948 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Fri, 9 Feb 2024 13:32:59 -0500 Subject: [PATCH] [#2157] Add Station and Docking Information When Available --- plugins/eddn.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/plugins/eddn.py b/plugins/eddn.py index b488d8e9..55ab729b 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -920,18 +920,24 @@ class EDDN: # none and that really does need to be recorded over EDDN so that # tools can update in a timely manner. if this.commodities != commodities: - self.send_message(cmdr, { + message: dict[str, Any] = { # Yes, this is a broad type hint. '$schemaRef': f'https://eddn.edcd.io/schemas/commodity/3{"/test" if is_beta else ""}', 'message': { - ('timestamp', entry['timestamp']), - ('systemName', entry['StarSystem']), - ('stationName', entry['StationName']), - ('marketId', entry['MarketID']), - ('commodities', commodities), - ('horizons', this.horizons), - ('odyssey', this.odyssey), - }, - }) + 'timestamp': entry['timestamp'], + 'systemName': entry['StarSystem'], + 'stationName': entry['StationName'], + 'marketId': entry['MarketID'], + 'commodities': commodities, + 'horizons': this.horizons, + 'odyssey': this.odyssey, + 'stationType': entry['StationType'], + } + } + + if entry.get('CarrierDockingAccess'): + message['message']['carrierDockingAccess'] = entry['CarrierDockingAccess'] + + self.send_message(cmdr, message) this.commodities = commodities