upower: Add a couple properties, and KbdBacklight bindings
This commit is contained in:
parent
badfc6a0bb
commit
eb5cd58587
3 changed files with 36 additions and 0 deletions
|
|
@ -111,6 +111,12 @@ trait Device {
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
fn temperature(&self) -> zbus::Result<f64>;
|
fn temperature(&self) -> zbus::Result<f64>;
|
||||||
|
|
||||||
|
#[zbus(property)]
|
||||||
|
fn time_to_empty(&self) -> zbus::Result<i64>;
|
||||||
|
|
||||||
|
#[zbus(property)]
|
||||||
|
fn time_to_full(&self) -> zbus::Result<i64>;
|
||||||
|
|
||||||
#[zbus(property, name = "Type")]
|
#[zbus(property, name = "Type")]
|
||||||
fn type_(&self) -> zbus::Result<BatteryType>;
|
fn type_(&self) -> zbus::Result<BatteryType>;
|
||||||
|
|
||||||
|
|
|
||||||
28
upower/src/kbdbacklight.rs
Normal file
28
upower/src/kbdbacklight.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
// Copyright 2021 System76 <info@system76.com>
|
||||||
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
|
use zbus::proxy;
|
||||||
|
|
||||||
|
#[proxy(
|
||||||
|
default_service = "org.freedesktop.UPower",
|
||||||
|
interface = "org.freedesktop.UPower.KbdBacklight",
|
||||||
|
default_path = "/org/freedesktop/UPower/KbdBacklight"
|
||||||
|
)]
|
||||||
|
trait KbdBacklight {
|
||||||
|
/// GetBrightness method
|
||||||
|
fn get_brightness(&self) -> zbus::Result<i32>;
|
||||||
|
|
||||||
|
/// GetMaxBrightness method
|
||||||
|
fn get_max_brightness(&self) -> zbus::Result<i32>;
|
||||||
|
|
||||||
|
/// SetBrightness method
|
||||||
|
fn set_brightness(&self, value: i32) -> zbus::Result<()>;
|
||||||
|
|
||||||
|
/// BrightnessChanged signal
|
||||||
|
#[zbus(signal)]
|
||||||
|
fn brightness_changed(&self, value: i32) -> zbus::Result<()>;
|
||||||
|
|
||||||
|
/// BrightnessChangedWithSource signal
|
||||||
|
#[zbus(signal)]
|
||||||
|
fn brightness_changed_with_source(&self, value: i32, source: &str) -> zbus::Result<()>;
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,9 @@
|
||||||
#![doc = include_str!("../README.md")]
|
#![doc = include_str!("../README.md")]
|
||||||
|
|
||||||
mod device;
|
mod device;
|
||||||
|
mod kbdbacklight;
|
||||||
mod upower;
|
mod upower;
|
||||||
|
|
||||||
pub use self::device::*;
|
pub use self::device::*;
|
||||||
|
pub use self::kbdbacklight::*;
|
||||||
pub use self::upower::*;
|
pub use self::upower::*;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue