-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
enhancementNew feature or requestNew feature or request
Description
A new way of defining D-Bus interfaces:
class org_example_Interface(bus.Interface):
# this is a D-Bus property
power_level: int
# this too
@property
def identifier(self) -> str:
raise NotImplementedError
@identifier.setter
def set_identifier(self, value: str) -> None:
raise NotImplementedError
# a bus method
def change(self, name: dict[str, bus.Variant]) -> list[str]:
raise NotImplementedError
# a signal
def changed(self, name: str) -> bus.Signal:
...
The above would result in an interface called org.example.Interface
with:
- read-only property
PowerLevel
of typeint
- read-only property
Identifier
of types
- method
Change
acceptinga{sv}
and returningas
- a signal
Changed
with a singles
value
Properties would be read-only unless a property.setter
was provided.
In order to export an object using the interface, you'd be expected to put it on the bus via an object which implements the interface.
class MyObject(bus.Object, org_example_Interface):
...
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request