Add property setter helper
This commit is contained in:
parent
b5a3c5f6aa
commit
90c97fb098
1 changed files with 5 additions and 0 deletions
5
utils.go
5
utils.go
|
@ -58,6 +58,11 @@ func (d *dbusBase) getProperty(iface string) (interface{}, error) {
|
||||||
return variant.Value(), err
|
return variant.Value(), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *dbusBase) setProperty(iface string, value interface{}) (error) {
|
||||||
|
err := d.obj.SetProperty(iface, dbus.MakeVariant(value))
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
func (d *dbusBase) getObjectProperty(iface string) (value dbus.ObjectPath, err error) {
|
func (d *dbusBase) getObjectProperty(iface string) (value dbus.ObjectPath, err error) {
|
||||||
prop, err := d.getProperty(iface)
|
prop, err := d.getProperty(iface)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Reference in a new issue