diff --git a/ignis/services/upower/device.py b/ignis/services/upower/device.py index 38164654..c0a7790b 100644 --- a/ignis/services/upower/device.py +++ b/ignis/services/upower/device.py @@ -40,6 +40,8 @@ def __init__(self, object_path: str): self.__watch_property("TimeToFull", "time-remaining") self.__watch_property("TimeToEmpty", "time-remaining") + self.__watch_property("Online", "online") + def __watch_property(self, dbus_property: str, *prop_names: str) -> None: self.__watching_props[dbus_property] = prop_names @@ -92,6 +94,13 @@ def available(self) -> bool: """ return self._proxy.IsPresent + @IgnisProperty + def online(self) -> bool: + """ + Whether the device is online. + """ + return self._proxy.Online + @IgnisProperty def percent(self) -> float: """