Dbus expand (#24)

* Dbus changes
  - Changed "FanMode", "ChargeLimit" to "SetFanMode", "SetChargeLimit"
  - Added dbus signals "FanModeChanged", "ChargeLimitChanged"
  - Added dbus methods "GetFanMode", "GetChargeLimit"
* Refactor of internal loop and tokio tasks
* Add support for ROG Strix G712LV_G712LV
* Correctly read the config before writing changes
This commit is contained in:
Luke Jones
2020-06-29 10:03:27 +12:00
committed by GitHub
parent 4922042432
commit 3ad15d61c9
12 changed files with 364 additions and 193 deletions

View File

@@ -110,8 +110,8 @@ impl AuraDbusWriter {
#[inline]
pub fn write_fan_mode(&self, level: u8) -> Result<String, Box<dyn std::error::Error>> {
let msg =
Message::new_method_call(DBUS_NAME, DBUS_PATH, DBUS_IFACE, "FanMode")?.append1(level);
let msg = Message::new_method_call(DBUS_NAME, DBUS_PATH, DBUS_IFACE, "SetFanMode")?
.append1(level);
let r = self
.connection
.send_with_reply_and_block(msg, Duration::from_millis(5000))?;
@@ -123,7 +123,7 @@ impl AuraDbusWriter {
#[inline]
pub fn write_charge_limit(&self, level: u8) -> Result<String, Box<dyn std::error::Error>> {
let msg = Message::new_method_call(DBUS_NAME, DBUS_PATH, DBUS_IFACE, "ChargeLimit")?
let msg = Message::new_method_call(DBUS_NAME, DBUS_PATH, DBUS_IFACE, "SetChargeLimit")?
.append1(level);
let r = self
.connection