... | ... | @@ -11,12 +11,23 @@ iface = dbus.Interface(upower, 'org.freedesktop.DBus.Introspectable') |
|
|
iface.Introspect()
|
|
|
```
|
|
|
|
|
|
This includes an interface called `org.freedesktop.UPower`. Call a method on this interface via the same object:
|
|
|
You can also use the `gdbus` tool to inspect the object:
|
|
|
``` bash
|
|
|
gdbus introspect --system --dest org.freedesktop.UPower --object-path /org/freedesktop/UPower
|
|
|
```
|
|
|
|
|
|
The UPower object includes an interface called `org.freedesktop.UPower`. Call a method on this interface via the same object:
|
|
|
``` python
|
|
|
iface = dbus.Interface(upower, 'org.freedesktop.UPower')
|
|
|
iface.EnumerateDevices()
|
|
|
```
|
|
|
|
|
|
This is how you call the same method using `gdbus`:
|
|
|
|
|
|
``` bash
|
|
|
gdbus call --system --dest org.freedesktop.UPower --object-path /org/freedesktop/UPower --method org.freedesktop.UPower.EnumerateDevices
|
|
|
```
|
|
|
|
|
|
## References
|
|
|
|
|
|
* https://dbus.freedesktop.org/doc/dbus-python/tutorial.html
|
... | ... | |