mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Begin rog-aura crate
This commit is contained in:
@@ -10,6 +10,7 @@ edition = "2018"
|
||||
# serialisation
|
||||
serde_json = "^1.0"
|
||||
rog_anime = { path = "../rog-anime" }
|
||||
rog_aura = { path = "../rog-aura" }
|
||||
rog_dbus = { path = "../rog-dbus" }
|
||||
rog_types = { path = "../rog-types" }
|
||||
daemon = { path = "../daemon" }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use rog_dbus::AuraDbusClient;
|
||||
use rog_types::aura_perkey::{GX502Layout, Key, KeyColourArray, KeyLayout};
|
||||
use rog_aura::{GX502Layout, Key, KeyColourArray, KeyLayout};
|
||||
use std::collections::LinkedList;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -1,5 +1,5 @@
|
||||
use rog_dbus::AuraDbusClient;
|
||||
use rog_types::aura_perkey::{GX502Layout, KeyColourArray, KeyLayout};
|
||||
use rog_aura::{GX502Layout, KeyColourArray, KeyLayout};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let (dbus, _) = AuraDbusClient::new()?;
|
||||
@@ -1,5 +1,5 @@
|
||||
use rog_dbus::AuraDbusClient;
|
||||
use rog_types::aura_perkey::{GX502Layout, Key, KeyColourArray, KeyLayout};
|
||||
use rog_aura::{GX502Layout, Key, KeyColourArray, KeyLayout};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let (dbus, _) = AuraDbusClient::new()?;
|
||||
@@ -1,5 +1,5 @@
|
||||
use rog_dbus::AuraDbusClient;
|
||||
use rog_types::aura_perkey::{Key, KeyColourArray};
|
||||
use rog_aura::{Key, KeyColourArray};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let (dbus, _) = AuraDbusClient::new()?;
|
||||
@@ -1,5 +1,5 @@
|
||||
use rog_dbus::AuraDbusClient;
|
||||
use rog_types::aura_perkey::{GX502Layout, KeyColourArray, KeyLayout};
|
||||
use rog_aura::{GX502Layout, KeyColourArray, KeyLayout};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let (dbus, _) = AuraDbusClient::new()?;
|
||||
@@ -1,5 +1,5 @@
|
||||
use gumdrop::Options;
|
||||
use rog_types::error::AuraError;
|
||||
use rog_aura::error::Error;
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
@@ -8,7 +8,7 @@ pub enum AnimeStatusValue {
|
||||
Off,
|
||||
}
|
||||
impl FromStr for AnimeStatusValue {
|
||||
type Err = AuraError;
|
||||
type Err = Error;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let s = s.to_lowercase();
|
||||
@@ -17,7 +17,7 @@ impl FromStr for AnimeStatusValue {
|
||||
"off" => Ok(AnimeStatusValue::Off),
|
||||
_ => {
|
||||
print!("Invalid argument, must be one of: on, off");
|
||||
Err(AuraError::ParseAnime)
|
||||
Err(Error::ParseAnime)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
use gumdrop::Options;
|
||||
use rog_types::{
|
||||
aura_modes::{AuraEffect, AuraModeNum, AuraZone, Colour, Direction, Speed},
|
||||
error::AuraError,
|
||||
};
|
||||
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, Colour, Direction, Speed, error::Error};
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(Options)]
|
||||
@@ -19,7 +16,7 @@ impl LedBrightness {
|
||||
}
|
||||
}
|
||||
impl FromStr for LedBrightness {
|
||||
type Err = AuraError;
|
||||
type Err = Error;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let s = s.to_lowercase();
|
||||
@@ -30,7 +27,7 @@ impl FromStr for LedBrightness {
|
||||
"high" => Ok(LedBrightness { level: Some(0x03) }),
|
||||
_ => {
|
||||
print!("Invalid argument, must be one of: off, low, med, high");
|
||||
Err(AuraError::ParseBrightness)
|
||||
Err(Error::ParseBrightness)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ use anime_cli::{AnimeActions, AnimeCommand};
|
||||
use gumdrop::{Opt, Options};
|
||||
use rog_anime::{AnimeDataBuffer, AnimeImage, Vec2, ANIME_DATA_LEN};
|
||||
use rog_dbus::AuraDbusClient;
|
||||
use rog_aura::{self, AuraEffect, AuraModeNum};
|
||||
use rog_types::{
|
||||
aura_modes::{self, AuraEffect, AuraModeNum},
|
||||
gfx_vendors::GfxVendors,
|
||||
profile::{FanLevel, ProfileCommand, ProfileEvent},
|
||||
supported::{
|
||||
@@ -215,7 +215,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
Some(level) => dbus
|
||||
.proxies()
|
||||
.led()
|
||||
.set_led_brightness(<aura_modes::LedBrightness>::from(level))?,
|
||||
.set_led_brightness(<rog_aura::LedBrightness>::from(level))?,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user