mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Update readme, slash configs
This commit is contained in:
@@ -11,7 +11,7 @@ pub struct InputBased {
|
||||
/// - temperature
|
||||
/// - fan speed
|
||||
/// - time
|
||||
input: Box<dyn InputForEffect>,
|
||||
input: Box<dyn InputForEffect>
|
||||
}
|
||||
|
||||
impl EffectState for InputBased {
|
||||
|
||||
@@ -19,7 +19,7 @@ pub struct Breathe {
|
||||
#[serde(skip)]
|
||||
count_flipped: bool,
|
||||
#[serde(skip)]
|
||||
use_colour1: bool,
|
||||
use_colour1: bool
|
||||
}
|
||||
|
||||
impl Breathe {
|
||||
@@ -31,7 +31,7 @@ impl Breathe {
|
||||
speed,
|
||||
colour: colour1,
|
||||
count_flipped: false,
|
||||
use_colour1: true,
|
||||
use_colour1: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ pub struct DoomFlicker {
|
||||
#[serde(skip)]
|
||||
count: u8,
|
||||
#[serde(skip)]
|
||||
colour: Colour,
|
||||
colour: Colour
|
||||
}
|
||||
|
||||
impl DoomFlicker {
|
||||
@@ -24,7 +24,7 @@ impl DoomFlicker {
|
||||
count: 4,
|
||||
max_percentage,
|
||||
min_percentage,
|
||||
start_colour: colour,
|
||||
start_colour: colour
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,13 +53,13 @@ impl EffectState for DoomFlicker {
|
||||
let max_light = Colour {
|
||||
r: (start_colour.r as f32 / 100.0 * *max_percentage as f32) as u8,
|
||||
g: (start_colour.g as f32 / 100.0 * *max_percentage as f32) as u8,
|
||||
b: (start_colour.b as f32 / 100.0 * *max_percentage as f32) as u8,
|
||||
b: (start_colour.b as f32 / 100.0 * *max_percentage as f32) as u8
|
||||
};
|
||||
// min light is a percentage of the set colour
|
||||
let min_light = Colour {
|
||||
r: (start_colour.r as f32 / 100.0 * *min_percentage as f32) as u8,
|
||||
g: (start_colour.g as f32 / 100.0 * *min_percentage as f32) as u8,
|
||||
b: (start_colour.b as f32 / 100.0 * *min_percentage as f32) as u8,
|
||||
b: (start_colour.b as f32 / 100.0 * *min_percentage as f32) as u8
|
||||
};
|
||||
|
||||
// Convert the 255 to percentage
|
||||
@@ -96,7 +96,7 @@ pub struct DoomLightFlash {
|
||||
#[serde(skip)]
|
||||
count: u8,
|
||||
#[serde(skip)]
|
||||
colour: Colour,
|
||||
colour: Colour
|
||||
}
|
||||
|
||||
impl DoomLightFlash {
|
||||
@@ -109,7 +109,7 @@ impl DoomLightFlash {
|
||||
min_percentage,
|
||||
start_colour: colour,
|
||||
max_time: 32,
|
||||
min_time: 7,
|
||||
min_time: 7
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,13 +135,13 @@ impl EffectState for DoomLightFlash {
|
||||
let max_light = Colour {
|
||||
r: (start_colour.r as f32 / 100.0 * *max_percentage as f32) as u8,
|
||||
g: (start_colour.g as f32 / 100.0 * *max_percentage as f32) as u8,
|
||||
b: (start_colour.b as f32 / 100.0 * *max_percentage as f32) as u8,
|
||||
b: (start_colour.b as f32 / 100.0 * *max_percentage as f32) as u8
|
||||
};
|
||||
// min light is a percentage of the set colour
|
||||
let min_light = Colour {
|
||||
r: (start_colour.r as f32 / 100.0 * *min_percentage as f32) as u8,
|
||||
g: (start_colour.g as f32 / 100.0 * *min_percentage as f32) as u8,
|
||||
b: (start_colour.b as f32 / 100.0 * *min_percentage as f32) as u8,
|
||||
b: (start_colour.b as f32 / 100.0 * *min_percentage as f32) as u8
|
||||
};
|
||||
|
||||
if *colour == max_light {
|
||||
|
||||
@@ -32,7 +32,7 @@ pub const RNDTABLE: [i32; 256] = [
|
||||
206, 163, 45, 63, 90, 168, 114, 59, 33, 159, 95, 28, 139, 123, 98, 125, 196, 15, 70, 194, 253,
|
||||
54, 14, 109, 226, 71, 17, 161, 93, 186, 87, 244, 138, 20, 52, 123, 251, 26, 36, 17, 46, 52,
|
||||
231, 232, 76, 31, 221, 84, 37, 216, 165, 212, 106, 197, 242, 98, 43, 39, 175, 254, 145, 190,
|
||||
84, 118, 222, 187, 136, 120, 163, 236, 249,
|
||||
84, 118, 222, 187, 136, 120, 163, 236, 249
|
||||
];
|
||||
|
||||
pub fn p_random() -> i32 {
|
||||
@@ -67,7 +67,7 @@ pub(crate) trait EffectState {
|
||||
#[derive(Debug, Deserialize, Serialize, Default)]
|
||||
pub struct AdvancedEffects {
|
||||
effects: Vec<Effect>,
|
||||
zoned: bool,
|
||||
zoned: bool
|
||||
}
|
||||
|
||||
impl AdvancedEffects {
|
||||
@@ -75,7 +75,7 @@ impl AdvancedEffects {
|
||||
pub fn new(zoned: bool) -> Self {
|
||||
Self {
|
||||
effects: Default::default(),
|
||||
zoned,
|
||||
zoned
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ pub enum Effect {
|
||||
Static(Static),
|
||||
Breathe(Breathe),
|
||||
DoomFlicker(DoomFlicker),
|
||||
DoomLightFlash(DoomLightFlash),
|
||||
DoomLightFlash(DoomLightFlash)
|
||||
}
|
||||
|
||||
impl Default for Effect {
|
||||
@@ -207,14 +207,12 @@ mod tests {
|
||||
fn single_key_next_state_then_create() {
|
||||
let layout = KeyLayout::default_layout();
|
||||
let mut seq = AdvancedEffects::new(false);
|
||||
seq.effects.push(Effect::Static(Static::new(
|
||||
LedCode::F,
|
||||
Colour {
|
||||
seq.effects
|
||||
.push(Effect::Static(Static::new(LedCode::F, Colour {
|
||||
r: 255,
|
||||
g: 127,
|
||||
b: 0,
|
||||
},
|
||||
)));
|
||||
b: 0
|
||||
})));
|
||||
|
||||
seq.next_state(&layout);
|
||||
let packets = seq.create_packets();
|
||||
@@ -234,14 +232,14 @@ mod tests {
|
||||
Colour {
|
||||
r: 255,
|
||||
g: 127,
|
||||
b: 0,
|
||||
b: 0
|
||||
},
|
||||
Colour {
|
||||
r: 127,
|
||||
g: 0,
|
||||
b: 255,
|
||||
b: 255
|
||||
},
|
||||
Speed::Med,
|
||||
Speed::Med
|
||||
)));
|
||||
|
||||
let s =
|
||||
@@ -276,10 +274,10 @@ mod tests {
|
||||
Colour {
|
||||
r: 255,
|
||||
g: 127,
|
||||
b: 80,
|
||||
b: 80
|
||||
},
|
||||
100,
|
||||
10,
|
||||
10
|
||||
)));
|
||||
|
||||
seq.next_state(&layout);
|
||||
|
||||
@@ -8,14 +8,14 @@ use crate::{effect_state_impl, Colour};
|
||||
pub struct Static {
|
||||
led: LedCode,
|
||||
/// The starting colour
|
||||
colour: Colour,
|
||||
colour: Colour
|
||||
}
|
||||
|
||||
impl Static {
|
||||
pub fn new(address: LedCode, colour: Colour) -> Self {
|
||||
Self {
|
||||
led: address,
|
||||
colour,
|
||||
colour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user