This commit is contained in:
Moritz Ruth 2024-02-05 00:13:03 +01:00
parent 66c86df2a4
commit 6b4ea3f4ae
Signed by: moritzruth
GPG key ID: C9BBAB79405EE56D
13 changed files with 819 additions and 375 deletions

View file

@ -210,9 +210,12 @@ async fn manage_knob(path: KnobPath, config: KnobConfig, mut events: broadcast::
loop {
tokio::select! {
Ok(volume_state) = volume_states.recv() => {
entity_state = volume_state.entities_by_id().values().find(|entity| state_matches(&config.target, entity)).map(Arc::clone);
update_knob_style(&entity_state);
update_knob_value(&entity_state);
let new_entity_state = volume_state.entities_by_id().values().find(|entity| state_matches(&config.target, entity)).map(Arc::clone);
if entity_state != new_entity_state {
entity_state = new_entity_state;
update_knob_style(&entity_state);
update_knob_value(&entity_state);
}
}
Ok((event_path, event)) = events.recv() => {