File tree Expand file tree Collapse file tree 9 files changed +35
-8
lines changed Expand file tree Collapse file tree 9 files changed +35
-8
lines changed Original file line number Diff line number Diff line change @@ -6,16 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66
77* It is strongly advised to perform an update of your tentacles after updating OctoBot. (start.py tentacles --install --all)*
88
9- ## [ 0.4.11] - 2022-10-12
9+ ## [ 0.4.12] - 2022-10-15
10+ ### Fixed
11+ - Copy trading
12+
13+ ## [ 0.4.11] - 2022-10-14
1014### Added
1115- User inputs system
1216- Phemex exchange
1317- Run storage
1418### Updated
1519- Configuration for each tentacle
1620- Community bot system instead of devices
17- ### Fixed
18- - Exchange API issues (Bybit, Kucoin)
1921
2022## [ 0.4.10] - 2022-09-13
2123### Updated
Original file line number Diff line number Diff line change 1- # OctoBot [ 0.4.11 ] ( https://octobot.click/gh-changelog )
1+ # OctoBot [ 0.4.12 ] ( https://octobot.click/gh-changelog )
22[ ![ PyPI] ( https://img.shields.io/pypi/v/OctoBot.svg )] ( https://octobot.click/gh-pypi )
33[ ![ Codacy Badge] ( https://api.codacy.com/project/badge/Grade/e07fb190156d4efb8e7d07aaa5eff2e1 )] ( https://app.codacy.com/gh/Drakkar-Software/OctoBot?utm_source=github.com&utm_medium=referral&utm_content=Drakkar-Software/OctoBot&utm_campaign=Badge_Grade_Dashboard ) [ ![ Downloads] ( https://pepy.tech/badge/octobot/month )] ( https://pepy.tech/project/octobot )
44[ ![ Dockerhub] ( https://img.shields.io/docker/pulls/drakkarsoftware/octobot.svg )] ( https://octobot.click/gh-dockerhub )
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ def _create_startup_config(logger):
120120 config .read (should_raise = False )
121121 else :
122122 _read_config (config , logger )
123+ _ensure_profile (config , logger )
123124 _validate_config (config , logger )
124125 return config
125126
@@ -135,6 +136,19 @@ def _read_config(config, logger):
135136 raise errors .ConfigError (e )
136137
137138
139+ def _ensure_profile (config , logger ):
140+ if config .profile is None :
141+ # no selected profile or profile not found
142+ try :
143+ config .select_profile (common_constants .DEFAULT_PROFILE )
144+ except KeyError :
145+ logger .error (f"Missing default profiles. Please make sure that the { config .profiles_path } "
146+ f"folder is accessible. To reinstall default profiles, delete the "
147+ f"'{ tentacles_manager_constants .TENTACLES_PATH } ' "
148+ f"folder or start OctoBot with the following arguments: tentacles --install --all" )
149+ raise errors .NoProfileError
150+
151+
138152def _validate_config (config , logger ):
139153 try :
140154 config .validate ()
Original file line number Diff line number Diff line change @@ -272,6 +272,8 @@ async def select_bot(self, bot_id):
272272 if fetched_bot is None :
273273 raise errors .BotNotFoundError (f"Can't find bot with id: { bot_id } " )
274274 self .user_account .set_selected_bot_raw_data (fetched_bot )
275+ bot_name = self .user_account .get_bot_name_or_id (self .user_account .get_selected_bot_raw_data ())
276+ self .logger .debug (f"Selected bot '{ bot_name } '" )
275277 self .user_account .gql_bot_id = bot_id
276278 self ._save_gql_bot_id (self .user_account .gql_bot_id )
277279 await self .on_new_bot_select ()
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ class CommunityUserAccount:
2222 BOT_DEVICE = "device"
2323 NO_SELECTED_BOT_DESC = "No selected bot. Please select a bot to enable your community features."
2424
25-
2625 def __init__ (self ):
2726 self .gql_user_id = None
2827 self .gql_bot_id = None
@@ -62,6 +61,12 @@ def get_selected_bot_device_uuid(self):
6261 except AttributeError :
6362 raise errors .NoBotDeviceError ("No device associated to the select bot" )
6463
64+ def get_selected_bot_device_name (self ):
65+ try :
66+ return self .get_selected_bot_raw_data (raise_on_missing = True ).get (self .BOT_DEVICE , {}).get ("name" , None )
67+ except AttributeError :
68+ raise errors .NoBotDeviceError ("No device associated to the select bot" )
69+
6570 @staticmethod
6671 def get_bot_id (bot ):
6772 return bot ["_id" ]
Original file line number Diff line number Diff line change @@ -267,7 +267,8 @@ async def _connect(self):
267267 self ._update_client_config (self ._mqtt_client )
268268 self ._register_callbacks (self ._mqtt_client )
269269 self ._mqtt_client .set_auth_credentials (self ._device_uuid , None )
270- self .logger .debug (f"Connecting client" )
270+ self .logger .debug (f"Connecting client using device "
271+ f"'{ self .authenticator .user_account .get_selected_bot_device_name ()} '" )
271272 self ._connect_task = asyncio .create_task (
272273 self ._mqtt_client .connect (self .feed_url , self .mqtt_broker_port , version = self .MQTT_VERSION )
273274 )
Original file line number Diff line number Diff line change 2121
2222PROJECT_NAME = "OctoBot"
2323AUTHOR = "DrakkarSoftware"
24- SHORT_VERSION = "0.4.11 " # major.minor.revision
24+ SHORT_VERSION = "0.4.12 " # major.minor.revision
2525PATCH_VERSION = "" # patch : pX
2626VERSION_DEV_PHASE = "" # alpha : a / beta : b / release candidate : rc
2727VERSION_PHASE = "" # XX
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ cython==0.29.26
33
44# Drakkar-Software requirements
55OctoBot-Commons == 1.7.24
6- OctoBot-Trading == 2.2.18
6+ OctoBot-Trading == 2.2.19
77OctoBot-Evaluators == 1.7.5
88OctoBot-Tentacles-Manager == 2.7.3
99OctoBot-Services == 1.3.6
Original file line number Diff line number Diff line change 3030
3131FEED_URL = "x.y.z"
3232TOKEN = "acb1"
33+ NAME = "name_a"
3334
3435
3536def _build_message (value , identifier ):
@@ -65,6 +66,8 @@ async def connected_community_feed(authenticator):
6566 feed .INIT_TIMEOUT = 1
6667 with mock .patch .object (authenticator .user_account , "get_selected_bot_device_uuid" , mock .Mock (return_value = TOKEN )) \
6768 as get_selected_bot_device_uuid_mock , \
69+ mock .patch .object (authenticator .user_account , "get_selected_bot_device_name" , mock .Mock (return_value = NAME )
70+ ) as _get_selected_bot_device_uuid_mock , \
6871 mock .patch .object (feed , "_subscribe" , mock .AsyncMock ()) as _subscribe_mock , \
6972 mock .patch .object (gmqtt .Client , "connect" , mock .AsyncMock ()) as _connect_mock :
7073 await feed .register_feed_callback (commons_enums .CommunityChannelTypes .SIGNAL , mock .AsyncMock ())
You can’t perform that action at this time.
0 commit comments