diff --git a/src/multilang_translator/translator_server/endpoints_db.py b/src/multilang_translator/translator_server/endpoints_db.py index f926062..7f8d981 100644 --- a/src/multilang_translator/translator_server/endpoints_db.py +++ b/src/multilang_translator/translator_server/endpoints_db.py @@ -18,13 +18,13 @@ ENDPOINTS: dict[int: Endpoint] = { # for now make sure, .id and key are the same ), 1: Endpoint( id=1, - name="Gate 1 Endpoint", - url="http://192.168.1.101:5000", + name="Gate 1", + url="http://pi3:5000", max_broadcasts=3, ), 2: Endpoint( id=2, - name="Gate 2 Endpoint", + name="Gate 2", url="http://192.168.1.102:5000", max_broadcasts=3, ), diff --git a/src/multilang_translator/translator_server/translator_server.py b/src/multilang_translator/translator_server/translator_server.py index 6dab81d..53c01ab 100644 --- a/src/multilang_translator/translator_server/translator_server.py +++ b/src/multilang_translator/translator_server/translator_server.py @@ -46,12 +46,17 @@ def init_endpoint(endpoint: Endpoint, languages: list[str]): config.transport = 'auto' # Configure the bigs - for conf in config.bigs: # TODO: this is now part of the endpoint group config - conf.loop = False + for big in config.bigs: # TODO: this is now part of the endpoint group config + big.loop = False + big.name = endpoint.name + #big.program_info = # Initialize the endpoint if config changed or if it's not already initialized if not multicast_client.get_status(base_url=endpoint.url)['is_initialized'] or config != CURRENT_ENDPOINT_CONFIG.get(endpoint.id): - multicast_client.init(config, base_url=endpoint.url) + ret = multicast_client.init(config, base_url=endpoint.url) + # if ret != 200: # TODO: this is not working, should probably be handled async + # log.error('Init of endpoint %s was unsucessfull', endpoint.name) + # raise Exception(f"Init was of endpoint {endpoint.name} was unsucessfull") CURRENT_ENDPOINT_CONFIG[endpoint.id] = config else: log.info('Endpoint %s was already initialized', endpoint.name)