Fix enum behavior for python 3.11

closes #8221
closes #8217
This commit is contained in:
Matthias 2023-02-25 13:34:19 +01:00
parent dc2cfee056
commit 563742f13c
2 changed files with 6 additions and 0 deletions

View File

@ -13,6 +13,9 @@ class CandleType(str, Enum):
FUNDING_RATE = "funding_rate" FUNDING_RATE = "funding_rate"
# BORROW_RATE = "borrow_rate" # * unimplemented # BORROW_RATE = "borrow_rate" # * unimplemented
def __str__(self):
return f"{self.name.lower()}"
@staticmethod @staticmethod
def from_string(value: str) -> 'CandleType': def from_string(value: str) -> 'CandleType':
if not value: if not value:

View File

@ -37,5 +37,8 @@ class RPCRequestType(str, Enum):
WHITELIST = 'whitelist' WHITELIST = 'whitelist'
ANALYZED_DF = 'analyzed_df' ANALYZED_DF = 'analyzed_df'
def __str__(self):
return self.value
NO_ECHO_MESSAGES = (RPCMessageType.ANALYZED_DF, RPCMessageType.WHITELIST, RPCMessageType.NEW_CANDLE) NO_ECHO_MESSAGES = (RPCMessageType.ANALYZED_DF, RPCMessageType.WHITELIST, RPCMessageType.NEW_CANDLE)