--- /dev/null
+use std::collections::HashMap;
+
+use wmi::{COMLibrary, Variant, WMIConnection};
+
+use crate::{a770, corsair_vengeance, rgb::RGB, sensors_jiji, AsusAuraUSB};
+
+pub fn tests() {
+ println!("Running some tests...");
+
+ test_asus_aura_usb(AsusAuraUSB::Motherboard::AsusCrosshairVIIIHero);
+ // list_usb_devices();
+ // test_roccat();
+ // test_wmi();
+ // test_corsair();
+ // test_a770();
+ // test_read_temp();
+
+ println!("Press any key to continue...");
+ std::io::stdin().read_line(&mut String::new()).unwrap();
+}
+
+fn test_wmi() {
+ let com_con = COMLibrary::new().unwrap();
+ let wmi_con = WMIConnection::new(com_con.into()).unwrap();
+
+ //let results: Vec<HashMap<String, Variant>> = wmi_con.raw_query("SELECT * FROM Win32_PnPSignedDriver WHERE Description LIKE '%SMBUS%' OR Description LIKE '%SM BUS%'").unwrap();
+ //let results: Vec<HashMap<String, Variant>> = wmi_con.raw_query("SELECT * FROM Win32_PnPSignedDriver WHERE Description LIKE 'Intel(R) NF I2C Host Controller'").unwrap();
+ let results: Vec<HashMap<String, Variant>> = wmi_con
+ .raw_query("SELECT * FROM Win32_PnPSignedDriver")
+ .unwrap();
+ //let results: Vec<HashMap<String, Variant>> = wmi_con.raw_query("SELECT * FROM Win32_PnPAllocatedResource").unwrap();
+
+ for os in results {
+ println!("-------------------");
+ println!("{:#?}", os);
+ }
+}
+
+fn list_usb_devices() {
+ let api = hidapi::HidApi::new().unwrap();
+ for device in api.device_list() {
+ println!("{:?}", device);
+ println!("name: {}", device.product_string().unwrap());
+ println!("interface number: {}", device.interface_number());
+ println!("page: {}", device.usage_page());
+ println!("usage: {}", device.usage());
+ println!("----");
+ }
+}
+
+// fn test_roccat() {
+// let api = hidapi::HidApi::new().unwrap();
+// let roccat_device = roccat::get_device(&api);
+
+// let manufacturer = roccat_device.get_manufacturer_string().unwrap();
+// dbg!(manufacturer);
+
+// let product = roccat_device.get_product_string().unwrap();
+// dbg!(product);
+
+// let serial = roccat_device.get_serial_number_string().unwrap();
+// dbg!(serial);
+
+// roccat::init(&roccat_device);
+// roccat::set_color(
+// &roccat_device,
+// &RGB {
+// red: 0,
+// green: 255,
+// blue: 40,
+// },
+// );
+// }
+
+fn test_asus_aura_usb(motherboard: AsusAuraUSB::Motherboard) {
+ let api = hidapi::HidApi::new().unwrap();
+
+ let device = AsusAuraUSB::Device::new(&api, motherboard);
+
+ println!("Firmware: {}", device.get_firmware_string());
+
+ let configuration = device.get_configuration_table();
+ println!("Configuration:");
+ for i in 0..60 {
+ print!("{:02X} ", configuration[i]);
+ if (i + 1) % 6 == 0 {
+ println!("");
+ }
+ }
+ println!("Number of addressable header: {}", configuration[0x02]);
+ println!("Number of leds: {}", configuration[0x1B]);
+ println!("Number of RGB headers: {}", configuration[0x1D]);
+
+ // Only once, at start.
+ device.set_fixed_mode();
+
+ device.set_color(&RGB {
+ red: 0,
+ green: 0,
+ blue: 255,
+ });
+
+ device.save_current_color();
+}
+
+fn test_corsair() {
+ let corsair_controllers = [
+ corsair_vengeance::Controller::new(0x19),
+ corsair_vengeance::Controller::new(0x1B),
+ ];
+ for controller in corsair_controllers {
+ controller.set_color(&RGB {
+ red: 0,
+ green: 0,
+ blue: 255,
+ });
+ }
+}
+
+fn test_a770() {
+ // a770::set_rgb(255, 0, 0);
+ let mut a770 = a770::A770::new();
+ a770.set_color(255, 0, 0);
+}
+
+fn test_read_temp() {
+ let sensors = sensors_jiji::Sensors::new();
+ println!("temp cpu: {}", sensors.read_cpu_temp());
+ println!("temp gpu: {}", sensors.read_gpu_temp());
+}