Skip to content

Commit

Permalink
Make sure to not sent update packet if there are no updates to make
Browse files Browse the repository at this point in the history
  • Loading branch information
confusinguser committed Feb 19, 2024
1 parent ef35c36 commit 630aac4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/keyboard_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,12 @@ impl KeyboardController {
}
}
}
lock.client
.update_leds(lock.controller_id, lock.current_colors.clone())
.await
.unwrap();
if !all_messages.is_empty() {
lock.client
.update_leds(lock.controller_id, lock.current_colors.clone())
.await
.unwrap();
}
drop(lock);

time_of_last_update = Instant::now();
Expand Down

0 comments on commit 630aac4

Please sign in to comment.