Many cleanup and fix

This commit is contained in:
Luke D. Jones
2024-04-17 11:52:27 +12:00
parent 3142353f98
commit 64e8cb65d0
15 changed files with 466 additions and 96 deletions

View File

@@ -594,7 +594,7 @@
power_zones: [Keyboard],
),
(
device_name: "GL553VE",
device_name: "GL553V",
product_id: "",
layout_name: "g533q",
basic_modes: [Static, Breathe, Strobe],
@@ -829,7 +829,7 @@
),
(
device_name: "GZ301Z",
product_id: "1a30",
product_id: "",
layout_name: "ga401q",
basic_modes: [Static, Breathe, Pulse],
basic_zones: [],
@@ -845,6 +845,15 @@
advanced_type: None,
power_zones: [None],
),
(
device_name: "GZ301Z",
product_id: "1a30",
layout_name: "ga401q",
basic_modes: [Static, Breathe, Pulse],
basic_zones: [],
advanced_type: None,
power_zones: [Keyboard],
),
(
device_name: "RC71L",
product_id: "",

View File

@@ -91,6 +91,7 @@ impl LedSupportFile {
if !config.product_id.is_empty() {
info!("Checking product ID");
if config.product_id == product_id {
info!("Matched to {}", config.product_id);
return Some(config.clone());
} else {
continue;
@@ -192,6 +193,7 @@ mod tests {
// Ensure the data is sorted
let mut tmp_sort = tmp.clone();
tmp_sort.0.sort_by(|a, b| a.product_id.cmp(&b.product_id));
tmp_sort.0.sort_by(|a, b| a.device_name.cmp(&b.device_name));
if tmp != tmp_sort {
let sorted =

View File

@@ -276,7 +276,6 @@ impl From<OldAuraPower> for u32 {
#[cfg(test)]
mod test {
use crate::aura_detection::LedSupportData;
use crate::keyboard::{AuraPowerState, LaptopAuraPower};
use crate::{AuraDeviceType, PowerZones};