Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ignis/services/upower/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
"""
Expand Down