diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 4438b55c..ff5b2cc6 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -529,6 +529,8 @@ class AppWindow: # Send ship info to EDSM on startup or change if entry['event'] in [None, 'LoadGame', 'ShipyardNew', 'ShipyardSwap']: self.edsm.setshipid(monitor.shipid) + elif entry['event'] in ['ShipyardBuy', 'ShipyardSell']: + self.edsm.sellship(entry.get('SellShipID')) # Write EDSM log on change if monitor.mode and entry['event'] in ['Location', 'FSDJump']: diff --git a/edsm.py b/edsm.py index 01f2e4e8..7ec35eba 100644 --- a/edsm.py +++ b/edsm.py @@ -171,3 +171,7 @@ class EDSM: def setshipid(self, shipid): if shipid is not None: self.call('api-commander-v1/set-ship-id', '&shipId=%d' % shipid) + + def sellship(self, shipid): + if shipid is not None: + self.call('api-commander-v1/sell-ship', '&shipId=%d' % shipid)