Add enable_ws config setting

This commit is contained in:
Matthias
2022-10-23 09:15:33 +02:00
parent 51890f80c4
commit 3468edddf6
3 changed files with 4 additions and 1 deletions

View File

@@ -539,6 +539,7 @@ CONF_SCHEMA = {
"type": "object", "type": "object",
"properties": { "properties": {
"name": {"type": "string"}, "name": {"type": "string"},
"enable_ws": {"type": "boolean", "default": True},
"key": {"type": "string", "default": ""}, "key": {"type": "string", "default": ""},
"secret": {"type": "string", "default": ""}, "secret": {"type": "string", "default": ""},
"password": {"type": "string", "default": ""}, "password": {"type": "string", "default": ""},

View File

@@ -233,7 +233,7 @@ class Exchange:
self._ws_async = self._init_ccxt(exchange_conf, False, ccxt_async_config) self._ws_async = self._init_ccxt(exchange_conf, False, ccxt_async_config)
self._has_watch_ohlcv = self.exchange_has("watchOHLCV") self._has_watch_ohlcv = self.exchange_has("watchOHLCV")
self._exchange_ws: Optional[ExchangeWS] = None self._exchange_ws: Optional[ExchangeWS] = None
if exchange_config.get('enable_ws', False) and self._has_watch_ohlcv: if exchange_config.get('enable_ws', True) and self._has_watch_ohlcv:
self._exchange_ws = ExchangeWS(self._config, self._ws_async) self._exchange_ws = ExchangeWS(self._config, self._ws_async)
logger.info(f'Using Exchange "{self.name}"') logger.info(f'Using Exchange "{self.name}"')

View File

@@ -587,6 +587,7 @@ def get_default_conf(testdatadir):
"exchange": { "exchange": {
"name": "binance", "name": "binance",
"key": "key", "key": "key",
"enable_ws": False,
"secret": "secret", "secret": "secret",
"pair_whitelist": ["ETH/BTC", "LTC/BTC", "XRP/BTC", "NEO/BTC"], "pair_whitelist": ["ETH/BTC", "LTC/BTC", "XRP/BTC", "NEO/BTC"],
"pair_blacklist": [ "pair_blacklist": [
@@ -628,6 +629,7 @@ def get_default_conf_usdt(testdatadir):
"name": "binance", "name": "binance",
"enabled": True, "enabled": True,
"key": "key", "key": "key",
"enable_ws": False,
"secret": "secret", "secret": "secret",
"pair_whitelist": [ "pair_whitelist": [
"ETH/USDT", "ETH/USDT",