refactor: remove constants and put in config file

removed all constants from all files and put them in src/control_backend/core/config.py
also removed some old mock agents that we don't use anymore

ref: N25B-236
This commit is contained in:
Pim Hutting
2025-11-05 13:43:57 +01:00
parent c6edad0bb4
commit 9e926178da
15 changed files with 136 additions and 73 deletions

View File

@@ -21,9 +21,9 @@ class RICommunicationAgent(Agent):
self,
jid: str,
password: str,
port: int = 5222,
port: int = settings.agent_settings.default_spade_port,
verify_security: bool = False,
address="tcp://localhost:0000",
address=settings.zmq_settings.ri_command_address,
bind=False,
):
super().__init__(jid, password, port, verify_security)
@@ -58,13 +58,13 @@ class RICommunicationAgent(Agent):
# See what endpoint we received
match message["endpoint"]:
case "ping":
await asyncio.sleep(1)
await asyncio.sleep(settings.agent_settings.behaviour_settings.ping_sleep_s)
case _:
logger.info(
"Received message with topic different than ping, while ping expected."
)
async def setup(self, max_retries: int = 5):
async def setup(self, max_retries: int = settings.behaviour_settings.comm_setup_max_retries):
"""
Try to setup the communication agent, we have 5 retries in case we dont have a response yet.
"""