[fix](trx-server): auto-generate rig IDs when not specified in config
When rigs are configured without explicit IDs in TOML, they now receive auto-generated IDs based on model name and index (e.g., "ft817_0", "soapysdr_1"). Previously, the default empty ID prevented auto-generation from triggering. Changes: - Set RigInstanceConfig default id to empty string (was "default") - This allows resolved_rigs() auto-generation to trigger for all rigs - Legacy single-rig path still gets explicit "default" ID - Auto-generated IDs now appear in HTTP API /rigs endpoint - Rig picker now displays auto-IDs correctly The fix ensures that rigs without explicit ids get proper identifiers that appear in the protocol and frontend selectors. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -54,7 +54,7 @@ pub struct RigInstanceConfig {
|
||||
impl Default for RigInstanceConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
id: "default".to_string(),
|
||||
id: String::new(), // Empty by default so auto-generation triggers in resolved_rigs()
|
||||
name: None,
|
||||
rig: RigConfig::default(),
|
||||
behavior: BehaviorConfig::default(),
|
||||
|
||||
@@ -461,6 +461,7 @@ mod tests {
|
||||
let _state_tx = state_tx;
|
||||
let handle = RigHandle {
|
||||
rig_id: "default".to_string(),
|
||||
display_name: "Default Rig".to_string(),
|
||||
rig_tx,
|
||||
state_rx,
|
||||
audio_port: 4531,
|
||||
|
||||
Reference in New Issue
Block a user