Fix some remaining type errors

This commit is contained in:
Matthias 2023-03-24 20:56:18 +01:00
parent ad58bac810
commit 281dd7785e
2 changed files with 4 additions and 5 deletions

View File

@ -948,7 +948,6 @@ class FreqtradeBot(LoggingMixin):
""" """
Sends rpc notification when a entry order occurred. Sends rpc notification when a entry order occurred.
""" """
msg_type = RPCMessageType.ENTRY_FILL if fill else RPCMessageType.ENTRY
open_rate = order.safe_price open_rate = order.safe_price
if open_rate is None: if open_rate is None:
@ -961,7 +960,7 @@ class FreqtradeBot(LoggingMixin):
msg: RPCBuyMsg = { msg: RPCBuyMsg = {
'trade_id': trade.id, 'trade_id': trade.id,
'type': msg_type, 'type': RPCMessageType.ENTRY_FILL if fill else RPCMessageType.ENTRY,
'buy_tag': trade.enter_tag, 'buy_tag': trade.enter_tag,
'enter_tag': trade.enter_tag, 'enter_tag': trade.enter_tag,
'exchange': trade.exchange.capitalize(), 'exchange': trade.exchange.capitalize(),
@ -1860,7 +1859,7 @@ class FreqtradeBot(LoggingMixin):
if prot_trig: if prot_trig:
msg: RPCProtectionMsg = { msg: RPCProtectionMsg = {
'type': RPCMessageType.PROTECTION_TRIGGER, 'type': RPCMessageType.PROTECTION_TRIGGER,
**prot_trig.to_json() **prot_trig.to_json() # type: ignore
} }
self.rpc.send_msg(msg) self.rpc.send_msg(msg)
@ -1868,7 +1867,7 @@ class FreqtradeBot(LoggingMixin):
if prot_trig_glb: if prot_trig_glb:
msg = { msg = {
'type': RPCMessageType.PROTECTION_TRIGGER_GLOBAL, 'type': RPCMessageType.PROTECTION_TRIGGER_GLOBAL,
**prot_trig_glb.to_json() **prot_trig_glb.to_json() # type: ignore
} }
self.rpc.send_msg(msg) self.rpc.send_msg(msg)

View File

@ -454,7 +454,7 @@ class Telegram(RPCHandler):
# Notification disabled # Notification disabled
return return
message = self.compose_message(deepcopy(msg), msg_type) message = self.compose_message(deepcopy(msg), msg_type) # type: ignore
if message: if message:
self._send_msg(message, disable_notification=(noti == 'silent')) self._send_msg(message, disable_notification=(noti == 'silent'))