diff --git a/upower/src/device.rs b/upower/src/device.rs index bb27812..9154361 100644 --- a/upower/src/device.rs +++ b/upower/src/device.rs @@ -63,6 +63,18 @@ pub enum BatteryLevel { Full = 8, } +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Deserialize_repr, Serialize_repr, OwnedValue)] +#[repr(u32)] +pub enum BatteryTechnology { + Unknown = 0, + LithiumIon = 1, + LithiumPolymer = 2, + LithiumIronPhosphate = 3, + LeadAcid = 4, + NickelCadmium = 5, + NickelMetalHydride = 6, +} + #[proxy( interface = "org.freedesktop.UPower.Device", default_service = "org.freedesktop.UPower", @@ -75,6 +87,21 @@ pub trait Device { #[zbus(property)] fn capacity(&self) -> zbus::Result; + #[zbus(property)] + fn charge_end_threshold(&self) -> zbus::Result; + + #[zbus(property)] + fn charge_start_threshold(&self) -> zbus::Result; + + #[zbus(property)] + fn charge_threshold_enabled(&self) -> zbus::Result; + + #[zbus(property)] + fn charge_threshold_settings_supported(&self) -> zbus::Result; + + #[zbus(property)] + fn charge_threshold_supported(&self) -> zbus::Result; + #[zbus(property)] fn energy(&self) -> zbus::Result; @@ -87,6 +114,9 @@ pub trait Device { #[zbus(property)] fn energy_full_design(&self) -> zbus::Result; + #[zbus(property)] + fn energy_rate(&self) -> zbus::Result; + #[zbus(property)] fn has_history(&self) -> zbus::Result; @@ -102,6 +132,7 @@ pub trait Device { #[zbus(property)] fn is_rechargeable(&self) -> zbus::Result; + #[deprecated(since="0.3.2", note="deprecated since 0.99.12")] #[zbus(property)] fn luminosity(&self) -> zbus::Result; @@ -128,6 +159,9 @@ pub trait Device { #[zbus(property)] fn state(&self) -> zbus::Result; + #[zbus(property)] + fn technology(&self) -> zbus::Result; + #[zbus(property)] fn temperature(&self) -> zbus::Result; @@ -145,4 +179,23 @@ pub trait Device { #[zbus(property)] fn voltage(&self) -> zbus::Result; + + #[zbus(property)] + fn voltage_min_design(&self) -> zbus::Result; + + #[zbus(signal)] + fn enable_charge_threshold(&self, message: bool) -> zbus::Result<()>; + + + // #[zbus(signal)] + // fn enable_charge_threshold(&self, charge_threshold: bool) -> zbus::Result<()>; + + #[zbus(signal)] + fn get_history(&self, type_: String, timespan: u32, resolution: u32) -> zbus::Result>; + + #[zbus(signal)] + fn get_statistics(&self, type_: String) -> zbus::Result<()>; + + #[zbus(signal)] + fn refresh(&self) -> zbus::Result<()>; }