Move tests in a separate module
[temp2RGB.git] / src / machine.rs
index 2c64735..d1ff5c4 100644 (file)
@@ -1,4 +1,4 @@
-use crate::{a770, b650_e, corsair_vengeance, rgb, sensors_jiji, winring0};
+use crate::{a770, corsair_vengeance, rgb, sensors_jiji, winring0, AsusAuraUSB};
 
 pub trait Machine {
     fn set_color(&mut self, color: &rgb::RGB);
@@ -8,7 +8,7 @@ pub trait Machine {
 
 pub struct MachineJiji {
     ram: Vec<corsair_vengeance::Controller>,
-    b650e_device: hidapi::HidDevice,
+    b650e_device: AsusAuraUSB::Device,
     a770: a770::A770,
     sensors: sensors_jiji::Sensors,
 }
@@ -21,11 +21,11 @@ impl MachineJiji {
                 corsair_vengeance::Controller::new(0x19),
                 corsair_vengeance::Controller::new(0x1B),
             ],
-            b650e_device: b650_e::get_device(&api),
+            b650e_device: AsusAuraUSB::Device::new(&api, AsusAuraUSB::Motherboard::Asus650e),
             a770: a770::A770::new(),
             sensors: sensors_jiji::Sensors::new(),
         };
-        b650_e::set_fixed_mode(&machine.b650e_device);
+        machine.b650e_device.set_fixed_mode();
         machine
     }
 }
@@ -35,7 +35,7 @@ impl Machine for MachineJiji {
         for controller in &self.ram {
             controller.set_color(&color);
         }
-        b650_e::set_color(&self.b650e_device, &color);
+        self.b650e_device.set_color(&color);
         self.a770.set_color(color.red, color.green, color.blue);
     }
     fn get_gpu_tmp(&self) -> f32 {