From 281dd7785ebf190460bdf483f0839799bcf55d58 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 24 Mar 2023 20:56:18 +0100 Subject: [PATCH] Fix some remaining type errors --- freqtrade/freqtradebot.py | 7 +++---- freqtrade/rpc/telegram.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 3aa1075d8..1f7b4493c 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -948,7 +948,6 @@ class FreqtradeBot(LoggingMixin): """ Sends rpc notification when a entry order occurred. """ - msg_type = RPCMessageType.ENTRY_FILL if fill else RPCMessageType.ENTRY open_rate = order.safe_price if open_rate is None: @@ -961,7 +960,7 @@ class FreqtradeBot(LoggingMixin): msg: RPCBuyMsg = { 'trade_id': trade.id, - 'type': msg_type, + 'type': RPCMessageType.ENTRY_FILL if fill else RPCMessageType.ENTRY, 'buy_tag': trade.enter_tag, 'enter_tag': trade.enter_tag, 'exchange': trade.exchange.capitalize(), @@ -1860,7 +1859,7 @@ class FreqtradeBot(LoggingMixin): if prot_trig: msg: RPCProtectionMsg = { 'type': RPCMessageType.PROTECTION_TRIGGER, - **prot_trig.to_json() + **prot_trig.to_json() # type: ignore } self.rpc.send_msg(msg) @@ -1868,7 +1867,7 @@ class FreqtradeBot(LoggingMixin): if prot_trig_glb: msg = { 'type': RPCMessageType.PROTECTION_TRIGGER_GLOBAL, - **prot_trig_glb.to_json() + **prot_trig_glb.to_json() # type: ignore } self.rpc.send_msg(msg) diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index 6f34b7325..d79d8ea76 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -454,7 +454,7 @@ class Telegram(RPCHandler): # Notification disabled return - message = self.compose_message(deepcopy(msg), msg_type) + message = self.compose_message(deepcopy(msg), msg_type) # type: ignore if message: self._send_msg(message, disable_notification=(noti == 'silent'))