Fix channel nomenclature

This commit is contained in:
Logan Cusano
2025-04-27 02:25:00 -04:00
parent 386df10fe6
commit 3871ee5970
3 changed files with 39 additions and 38 deletions

View File

@@ -3,7 +3,8 @@ import websockets
import json
import uuid
import os
from drb_cdb_api import DRBCDBAPI, ConfigGenerator
from drb_cdb_api import DRBCDBAPI
from drb_cdb_types import ConfigGenerator
from server_api import RadioAPIClient
from enum import Enum
@@ -58,21 +59,21 @@ async def join_server(system_id, guild_id, channel_id):
op25_status = await drb_api.get_op25_status()
print("OP25 status:", op25_status)
# Check if OP25 is stopped, if so set the selected channel, otherwise
# Check if OP25 is stopped, if so set the selected system, otherwise do nothing
if 'status' not in op25_status or op25_status['status'] == "stopped":
chn_details = await srv_api.get_channel_details(channel_id)
print("Channel details", chn_details)
if not chn_details:
sys_details = await srv_api.get_system_details(system_id)
print("System details:", sys_details)
if not sys_details:
# TODO - handle not having channel details
pass
# Generate the config for the channel requested
chn_config = ConfigGenerator(
type=chn_details['decode_mode'],
systemName=chn_details['name'],
channels=chn_details['frequency_list_khz'],
tags=chn_details['tags'],
whitelist=chn_details['tag_whitelist'])
type=sys_details['decode_mode'],
systemName=sys_details['name'],
frequencys=sys_details['frequency_list_khz'],
tags=sys_details['tags'],
whitelist=sys_details['tag_whitelist'])
# Set the OP25 config
drb_api.generate_op25_config(chn_config)
@@ -85,7 +86,7 @@ async def join_server(system_id, guild_id, channel_id):
async def leave_server(guild_id):
# Takes guild ID
bot_status = await drb_api.get_bot_status()
print("Bot status", bot_status)
print("Bot status:", bot_status)
# Check if the bot is running
if 'bot_running' not in bot_status or not bot_status['bot_running']: