mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Add tests, G513L laptop
This commit is contained in:
@@ -80,6 +80,15 @@
|
||||
advanced_type: None,
|
||||
power_zones: [Keyboard],
|
||||
),
|
||||
(
|
||||
device_name: "G512L",
|
||||
product_id: "",
|
||||
layout_name: "g512",
|
||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
||||
basic_zones: [Key1, Key2, Key3, Key4],
|
||||
advanced_type: None,
|
||||
power_zones: [Keyboard, Lightbar],
|
||||
),
|
||||
(
|
||||
device_name: "G513I",
|
||||
product_id: "",
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
use std::env;
|
||||
|
||||
use dmi_id::DMIID;
|
||||
use log::{error, info, warn};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
@@ -60,7 +62,10 @@ impl LedSupportData {
|
||||
/// matches against laptops first, then will proceed with matching the
|
||||
/// `device_name` if there are no DMI matches.
|
||||
pub fn get_data(product_id: &str) -> Self {
|
||||
let dmi = DMIID::new().unwrap_or_default();
|
||||
let mut dmi = DMIID::new().unwrap_or_default();
|
||||
if let Ok(board_name) = env::var("BOARD_NAME") {
|
||||
dmi.board_name = board_name;
|
||||
}
|
||||
// let prod_family = dmi.product_family().expect("Could not get
|
||||
// product_family");
|
||||
|
||||
|
||||
@@ -434,7 +434,7 @@ impl From<AuraZone> for i32 {
|
||||
/// ```
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
||||
pub struct AuraEffect {
|
||||
/// The effect type
|
||||
pub mode: AuraModeNum,
|
||||
|
||||
@@ -488,7 +488,7 @@ mod tests {
|
||||
let rows = &data.key_rows;
|
||||
for row in rows {
|
||||
for k in &row.row {
|
||||
if data.key_shapes.get(&k.1).is_some() {
|
||||
if data.key_shapes.contains_key(&k.1) {
|
||||
unused.remove(&k.1);
|
||||
} else {
|
||||
panic!("Key {:?} was missing matching shape {}", k.0, k.1);
|
||||
|
||||
Reference in New Issue
Block a user