Skip to content

Commit

Permalink
fix: only use multiple zones for split lights
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmay committed Feb 23, 2025
1 parent b99f2c0 commit e3a5033
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions robotica-backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ fn auto_light(
&SendOptions::new(),
);

send_to_device(&config.id, &config.device, pc, discover, init_state);
send_to_device(&config.id, &config.device, pc, discover, init_state, false);
}

fn split_light(
Expand Down Expand Up @@ -690,7 +690,7 @@ fn strip_light(

let pc = lights::run_merge_light(combined_rx, &config.id, merge_config);

send_to_device(&config.id, &config.device, pc, discover, init_state);
send_to_device(&config.id, &config.device, pc, discover, init_state, true);
}

#[instrument(skip_all)]
Expand All @@ -700,14 +700,15 @@ fn send_to_device(
pc: stateful::Receiver<PowerColor>,
discover: &stateless::Receiver<lifx::Device>,
init_state: &InitState,
multiple_zones: bool,
) {
let id_clone = id.clone();
let output = match device {
config::LightDeviceConfig::Lifx { lifx_id } => lifx::device_entity(
pc,
*lifx_id,
discover,
DeviceConfig::default().set_multiple_zones(true),
DeviceConfig::default().set_multiple_zones(multiple_zones),
),
config::LightDeviceConfig::Debug { lifx_id } => {
let lifx_id = *lifx_id;
Expand Down

0 comments on commit e3a5033

Please sign in to comment.