update endpoint url and endpoint broadcast name

This commit is contained in:
2025-03-18 13:57:50 +01:00
parent fcb85972f4
commit 12a8617fc2
2 changed files with 11 additions and 6 deletions
@@ -18,13 +18,13 @@ ENDPOINTS: dict[int: Endpoint] = { # for now make sure, .id and key are the same
), ),
1: Endpoint( 1: Endpoint(
id=1, id=1,
name="Gate 1 Endpoint", name="Gate 1",
url="http://192.168.1.101:5000", url="http://pi3:5000",
max_broadcasts=3, max_broadcasts=3,
), ),
2: Endpoint( 2: Endpoint(
id=2, id=2,
name="Gate 2 Endpoint", name="Gate 2",
url="http://192.168.1.102:5000", url="http://192.168.1.102:5000",
max_broadcasts=3, max_broadcasts=3,
), ),
@@ -46,12 +46,17 @@ def init_endpoint(endpoint: Endpoint, languages: list[str]):
config.transport = 'auto' config.transport = 'auto'
# Configure the bigs # Configure the bigs
for conf in config.bigs: # TODO: this is now part of the endpoint group config for big in config.bigs: # TODO: this is now part of the endpoint group config
conf.loop = False big.loop = False
big.name = endpoint.name
#big.program_info =
# Initialize the endpoint if config changed or if it's not already initialized # 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): 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 CURRENT_ENDPOINT_CONFIG[endpoint.id] = config
else: else:
log.info('Endpoint %s was already initialized', endpoint.name) log.info('Endpoint %s was already initialized', endpoint.name)