whittlem / pycryptobot

Python Crypto Bot (PyCryptoBot)
Apache License 2.0
1.96k stars 736 forks source link

8.0.2 kucoin granularity causes failure #785

Closed jmcnab006 closed 1 year ago

jmcnab006 commented 1 year ago

when using the kucoin exchange this TypeError is thrown.

Bot1 2023-04-09 08:28:50 DOGE-USDT 15min Restarting application in 30 seconds after exception: TypeError('Granularity options: 1min, 3min, 5min, 15min, 30min, 1hour, 6hour, 1day')

I believe this is due to the following changes

975,976c975,976
<         # validates the granularity is supported by Coinbase
<         if isinstance(granularity_any, Granularity) and (granularity_any.to_integer not in SUPPORTED_GRANULARITY):
---
>         # validates the granularity is supported by Kucoin
>         if isinstance(granularity, Granularity) and (granularity.to_medium not in SUPPORTED_GRANULARITY):
978c978
<         elif isinstance(granularity_any, int) and (granularity_any not in SUPPORTED_GRANULARITY):
---
>         elif isinstance(granularity, str) and (granularity not in SUPPORTED_GRANULARITY):
981,985d980
<         if isinstance(granularity_any, Granularity):
<             granularity = granularity_any.to_integer
<         else:
<             granularity = granularity_any
< 
whittlem commented 1 year ago

This is fixed in 8.0.6.